diff --git a/proxy_docker/app/script/sendtobitcoinnode.sh b/proxy_docker/app/script/sendtobitcoinnode.sh index e5fe52b..cff8cb5 100644 --- a/proxy_docker/app/script/sendtobitcoinnode.sh +++ b/proxy_docker/app/script/sendtobitcoinnode.sh @@ -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}