mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-18 21:25:06 +01:00
Small fixes in removefrombatch and watchtxid
This commit is contained in:
@@ -264,7 +264,8 @@ removefrombatch() {
|
||||
trace "[removefrombatch] id missing"
|
||||
response='{"result":null,"error":{"code":-32700,"message":"outputId is required","data":'${request}'}}'
|
||||
else
|
||||
batcher_id=$(sql "SELECT batcher_id FROM recipient WHERE id=${id}")
|
||||
# We don't want to remove an already spent output
|
||||
batcher_id=$(sql "SELECT batcher_id FROM recipient WHERE id=${id} AND tx_id IS NULL")
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
|
||||
|
||||
@@ -342,6 +342,8 @@ watchtxidrequest() {
|
||||
trace "[watchtxidrequest] cbxconf_url=${cbxconf_url}"
|
||||
local nbxconf=$(echo "${request}" | jq ".nbxconf")
|
||||
trace "[watchtxidrequest] nbxconf=${nbxconf}"
|
||||
local cb1cond
|
||||
local cbxcond
|
||||
local inserted
|
||||
local id_inserted
|
||||
local result
|
||||
@@ -353,7 +355,17 @@ watchtxidrequest() {
|
||||
|
||||
if [ "${returncode}" -eq 0 ]; then
|
||||
inserted=1
|
||||
id_inserted=$(sql "SELECT id FROM watching_by_txid WHERE txid=${txid} AND callback1conf=${cb1conf_url} AND callbackxconf=${cbxconf_url}")
|
||||
if [ "${cb1conf_url}" = "null" ]; then
|
||||
cb1cond=" IS NULL"
|
||||
else
|
||||
cb1cond="=${cb1conf_url}"
|
||||
fi
|
||||
if [ "${cbxconf_url}" = "null" ]; then
|
||||
cbxcond=" IS NULL"
|
||||
else
|
||||
cbxcond="=${cbxconf_url}"
|
||||
fi
|
||||
id_inserted=$(sql "SELECT id FROM watching_by_txid WHERE txid=${txid} AND callback1conf${cb1cond} AND callbackxconf${cbxcond}")
|
||||
trace "[watchtxidrequest] id_inserted: ${id_inserted}"
|
||||
else
|
||||
inserted=0
|
||||
|
||||
Reference in New Issue
Block a user