Multiple watching wallets, must try them all

This commit is contained in:
kexkey
2019-03-04 18:57:16 -05:00
committed by kexkey
parent 4a72c18937
commit 6787f9cee2

View File

@@ -7,6 +7,15 @@ send_to_watcher_node() {
send_to_bitcoin_node ${WATCHER_NODE_RPC_URL}/${WATCHER_BTC_NODE_DEFAULT_WALLET} ${WATCHER_NODE_RPC_CFG} $@
local returncode=$?
trace_rc ${returncode}
if [ "${returncode}" -ne 0 ]; then
# Ok, since we now have multiple watching wallets, we need to try them all if it fails
# We have 2 right now: watching and watching-for-xpubs
send_to_watcher_node_wallet ${WATCHER_BTC_NODE_XPUB_WALLET} $@
returncode=$?
trace_rc ${returncode}
}
return ${returncode}
}
@@ -15,7 +24,7 @@ send_to_watcher_node_wallet() {
local walletname=$1
shift
trace "[send_to_watcher_node_wallet] walletname=${walletname}"
send_to_bitcoin_node ${WATCHER_NODE_RPC_URL}/$walletname ${WATCHER_NODE_RPC_CFG} $@
send_to_bitcoin_node ${WATCHER_NODE_RPC_URL}/${walletname} ${WATCHER_NODE_RPC_CFG} $@
local returncode=$?
trace_rc ${returncode}
return ${returncode}