Small fixes in removefrombatch and watchtxid

This commit is contained in:
kexkey
2021-03-22 10:34:39 -04:00
parent b86eda1e4a
commit a2efce08df
2 changed files with 15 additions and 2 deletions

View File

@@ -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}