mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-17 12:45:22 +01:00
unwatch wasn't unwatching when webhooks not supplied
This commit is contained in:
@@ -33,7 +33,7 @@ Proxy response:
|
|||||||
|
|
||||||
### Un-watch a previously watched Bitcoin Address (called by your application)
|
### Un-watch a previously watched Bitcoin Address (called by your application)
|
||||||
|
|
||||||
Updates the watched address row in DB so that webhooks won't be called on tx confirmations for that address. You can POST the URLs to make sure you unwatch the good watcher, since there may be multiple watchers on the same address with different webhook URLs. You can also, more conveniently, supply the watch id to unwatch.
|
Updates the watched address row in DB so that webhooks won't be called on tx confirmations for that address. You can POST the URLs to make sure you unwatch the good watcher, since there may be multiple watchers on the same address with different webhook URLs. If you don't supply URLs and there are several watchers on the same address for different URLs, all watchers will be turned off for that address. You can also, more conveniently, supply the watch id to unwatch.
|
||||||
|
|
||||||
```http
|
```http
|
||||||
GET http://cyphernode:8888/unwatch/2N8DcqzfkYi8CkYzvNNS5amoq3SbAcQNXKp
|
GET http://cyphernode:8888/unwatch/2N8DcqzfkYi8CkYzvNNS5amoq3SbAcQNXKp
|
||||||
|
|||||||
@@ -20,7 +20,17 @@ unwatchrequest() {
|
|||||||
|
|
||||||
data="{\"event\":\"unwatch\",\"id\":${watchid}}"
|
data="{\"event\":\"unwatch\",\"id\":${watchid}}"
|
||||||
else
|
else
|
||||||
sql "UPDATE watching SET watching=0 WHERE address='${address}' AND callback0conf=${unconfirmedCallbackURL} AND callback1conf=${confirmedCallbackURL}"
|
local cb0_where=
|
||||||
|
local cb1_where=
|
||||||
|
|
||||||
|
if [ "${unconfirmedCallbackURL}" != "null" ]; then
|
||||||
|
cb0_where=" AND callback0conf='${unconfirmedCallbackURL}'"
|
||||||
|
fi
|
||||||
|
if [ "${confirmedCallbackURL}" != "null" ]; then
|
||||||
|
cb1_where=" AND callback1conf='${confirmedCallbackURL}'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sql "UPDATE watching SET watching=0 WHERE address='${address}'${cb0_where}${cb1_where}"
|
||||||
returncode=$?
|
returncode=$?
|
||||||
trace_rc ${returncode}
|
trace_rc ${returncode}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user