From 8b0954bf85f3d746a49573da8463c7a7db97336d Mon Sep 17 00:00:00 2001 From: g-homebase Date: Tue, 17 Dec 2019 11:23:48 -0500 Subject: [PATCH] Seperate JQ select not to break return code from get_transactions --- proxy_docker/app/script/confirmation.sh | 9 +++++---- proxy_docker/app/script/getactivewatches.sh | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/proxy_docker/app/script/confirmation.sh b/proxy_docker/app/script/confirmation.sh index e2d8c54..32f519e 100644 --- a/proxy_docker/app/script/confirmation.sh +++ b/proxy_docker/app/script/confirmation.sh @@ -29,10 +29,9 @@ confirmation() { local returncode local txid=${1} + local txn_payload local tx_details - # We need make sure to discard error results generated by get_transction tryin to find a watching wallet's `txn in - # spender wallet first,return code will tell if there's an actaul error. See #153 - tx_details=$(get_transaction ${txid} | jq '. | select(.result != null)') + txn_payload="$(get_transaction ${txid})" returncode=$? trace_rc ${returncode} trace "[confirmation] tx_details=${tx_details}" @@ -40,7 +39,9 @@ confirmation() { trace "[confirmation] Transaction not in watcher, exiting." return 0 fi - + # We need make sure to discard error results generated by get_transction tryin to find a watching wallet's `txn in + # spender wallet first,return code will tell if there's an actaul error. See #153 + tx_details="$(echo $txn_payload | jq '. | select(.result != null)')" ######################################################################################################## # First of all, let's make sure we're working on watched addresses... local address diff --git a/proxy_docker/app/script/getactivewatches.sh b/proxy_docker/app/script/getactivewatches.sh index d0323cd..305abda 100644 --- a/proxy_docker/app/script/getactivewatches.sh +++ b/proxy_docker/app/script/getactivewatches.sh @@ -42,8 +42,8 @@ get_unused_addresses_by_watchlabel(){ AND NOT EXISTS ( SELECT 1 FROM watching_tx WHERE watching_id = w.id ) - LIMIT 0,${2-10} ORDER BY w.pub32_index ASC + LIMIT 0,${2-10} HERE ) label_unused_addrs=$(sql "$query")