mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-01-09 16:05:47 +01:00
Fix issue #153
This commit is contained in:
@@ -30,7 +30,9 @@ confirmation() {
|
||||
local returncode
|
||||
local txid=${1}
|
||||
local tx_details
|
||||
tx_details=$(get_transaction ${txid})
|
||||
# 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. FIXME Add issue here
|
||||
tx_details=$(get_transaction ${txid} | jq '. | select(.result != null)')
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
trace "[confirmation] tx_details=${tx_details}"
|
||||
@@ -68,7 +70,7 @@ confirmation() {
|
||||
local tx=$(sql "SELECT id FROM tx WHERE txid=\"${txid}\"")
|
||||
local id_inserted
|
||||
local tx_raw_details=$(get_rawtransaction ${txid})
|
||||
local tx_nb_conf=$(echo "${tx_details}" | jq '.result.confirmations')
|
||||
local tx_nb_conf=$(echo "${tx_details}" | jq -r '.result.confirmations // 0')
|
||||
|
||||
# Sometimes raw tx are too long to be passed as paramater, so let's write
|
||||
# it to a temp file for it to be read by sqlite3 and then delete the file
|
||||
|
||||
@@ -38,9 +38,10 @@ get_unused_addresses_by_watchlabel(){
|
||||
FROM watching as w
|
||||
INNER JOIN watching_by_pub32 AS w32 ON w.watching_by_pub32_id = w32.id
|
||||
WHERE w32.label="$1"
|
||||
AND w.id NOT IN (
|
||||
SELECT watching_id FROM watching_tx
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM watching_tx WHERE watching_id = w.id
|
||||
)
|
||||
ORDER BY w.pub32_index ASC
|
||||
HERE
|
||||
)
|
||||
label_unused_addrs=$(sql "$query")
|
||||
|
||||
@@ -197,7 +197,7 @@ getbalancebyxpub() {
|
||||
|
||||
echo "${data}"
|
||||
|
||||
return ${returncode}
|
||||
return "${returncode}"
|
||||
}
|
||||
|
||||
getnewaddress() {
|
||||
|
||||
Reference in New Issue
Block a user