This commit is contained in:
g-homebase
2019-12-12 19:39:13 -05:00
committed by kexkey
parent 27e2817a61
commit e8306f8a8a
3 changed files with 8 additions and 5 deletions

View File

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

View 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")

View File

@@ -197,7 +197,7 @@ getbalancebyxpub() {
echo "${data}"
return ${returncode}
return "${returncode}"
}
getnewaddress() {