Skip to content

Commit

Permalink
FixeS
Browse files Browse the repository at this point in the history
  • Loading branch information
gabidi authored and Kexkey committed Dec 3, 2019
1 parent d43c4a7 commit 0ac083a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions proxy_docker/app/script/walletoperations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ getbalancebyxpub() {
local returncode

# addresses=$(./bitcoin-cli -rpcwallet=xpubwatching01.dat getaddressesbylabel upub5GtUcgGed1aGH4HKQ3vMYrsmLXwmHhS1AeX33ZvDgZiyvkGhNTvGd2TA5Lr4v239Fzjj4ZY48t6wTtXUy2yRgapf37QHgt6KWEZ6bgsCLpb | jq "keys" | tr -d '\n ')
data="{\"method\":\"getaddressesbylabel\",\"params\":[${xpub}]}"
data="{\"method\":\"getaddressesbylabel\",\"params\":[\"${xpub}\"]}"
trace "[getbalancebyxpub] data=${data}"
addresses=$(send_to_xpub_watcher_wallet ${data} | jq "keys" | tr -d '\n ')
addresses=$(send_to_xpub_watcher_wallet ${data} | jq ".result | keys" | tr -d '\n ')

# ./bitcoin-cli -rpcwallet=xpubwatching01.dat listunspent 0 9999999 "$addresses" | jq "[.[].amount] | add"

data="{\"method\":\"listunspent\",\"params\":[0, 9999999, \"${addresses}\"]}"
data="{\"method\":\"listunspent\",\"params\":[0,9999999,\"${addresses}\"]}"
trace "[getbalancebyxpub] data=${data}"
balance=$(send_to_xpub_watcher_wallet ${data} | jq "[.[].amount] | add | . * 100000000 | trunc | . / 100000000")
balance=$(send_to_xpub_watcher_wallet ${data} | jq "[.result[].amount] | add | . * 100000000 | trunc | . / 100000000")
returncode=$?
trace_rc ${returncode}
trace "[getbalancebyxpub] balance=${balance}"
Expand Down

0 comments on commit 0ac083a

Please sign in to comment.