Skip to content

Commit

Permalink
Merge pull request #58 from bitbegin/fix2
Browse files Browse the repository at this point in the history
FIX: spent all accout 0 value, will not display accout 1 balance
  • Loading branch information
qtxie authored Jul 1, 2019
2 parents ecc950c + bcceb14 commit 913e6fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion keys/keys.red
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,14 @@ keys: context [
get-balance: func [network idx /local res][
if unused-idx > -1 [return reduce [rejoin ["Unused Account #" idx + 1]]]
res: enum-address-info bip32-path idx network
if zero256? res/balance [unused-idx: idx]
if all [
1 = length? res/change
1 = length? res/origin
res/change/1/tx-count = 0
res/change/1/unconfirmed-tx-count = 0
res/origin/1/tx-count = 0
res/origin/1/unconfirmed-tx-count = 0
][unused-idx: idx]
put btc-accounts idx res
form-i256 res/balance 8 8
]
Expand Down

0 comments on commit 913e6fb

Please sign in to comment.