0

I am seeing a smaller amount of BTC when I run ./bitcoin-cli getbalance compared to ./bitcoin-cli getbalance "" Here is the documentation on GetBalance from the BTC wiki, which highlights why I am confused

getbalance [account] [minconf=1]

If [account] is not specified, returns the server's total available balance. If [account] is specified, returns the balance in the account.

If no account is specified, it should return the server's total balance, and yet here is my result:

./bitcoin-cli getbalance --- 0.00001250

./bitcoin-cli getbalance "" --- 0.34869089

Why is this happening?

2 Answers 2

0

NULL and an empty string are interpreted differently. An empty string has no values. It’s an empty char array, one that hasn’t been assigned any elements. The string exists in memory, so it’s not NULL. Therefore we have two different labels and two different balances associated with those labels.

3
  • Thanks, how do I move the bitcoin into the main balance so I can run sendtoaddress without an account argument? Commented Nov 22, 2019 at 20:40
  • Also, when I use listaccounts there is only one account, so I'm not sure why there are 2 separate balances Commented Nov 22, 2019 at 21:06
  • Accounts were deprecated a couple years ago. In version 0.17 labels were introduced as a "replacement" for accounts however the main differences are you can't spend from a label and labels don't have balances. bitcoin.org/en/release/…
    – m1xolyd1an
    Commented Nov 23, 2019 at 18:46
0

It turns out that the reason was because the blockchain (Bitcoin Cash) had hardforked, after updating to the latest version my issue was resolved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.