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

CC BY-SA 4.0
2019-11-27T01:22:54.673Z
2019-11-27T01:22:54.673Z
Barney Chambers
<p>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. </p>

CC BY-SA 4.0
2019-11-22T20:40:51.230Z
Thanks, how do I move the bitcoin into the main balance so I can run sendtoaddress without an account argument?
Barney Chambers
CC BY-SA 4.0
2019-11-22T21:06:56.377Z
Also, when I use `listaccounts` there is only one account, so I'm not sure why there are 2 separate balances
Barney Chambers
CC BY-SA 4.0
2019-11-23T18:46:32.433Z
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. https://bitcoin.org/en/release/v0.17.0#configuration-sections-for-testnet-and-regtest
m1xolyd1an
CC BY-SA 4.0
2019-11-22T04:05:55.803Z
2019-11-22T04:05:55.803Z
m1xolyd1an
<p>I am seeing a smaller amount of BTC when I run <code>./bitcoin-cli getbalance</code> compared to <code>./bitcoin-cli getbalance ""</code> Here is the documentation on GetBalance from the BTC wiki, which highlights why I am confused</p>

<p><code>getbalance [account] [minconf=1]</code></p>

<p><code>If [account] is not specified, returns the server's total available balance.</code>
<code>If [account] is specified, returns the balance in the account.</code></p>

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

<p><code>./bitcoin-cli getbalance --- 0.00001250</code></p>

<p><code>./bitcoin-cli getbalance "" --- 0.34869089</code></p>

<p>Why is this happening?</p>

<json-rpc><balance><daemon><cli>
Unexpected behaviour Bitcoin RPC getbalance
Barney Chambers
# Unexpected behaviour Bitcoin RPC getbalance

(Asked by: username_0 on 2019-11-21)

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?

**Tags:** json-rpc, balance, daemon, cli


---

## 2 answers

### Answer by username_0 on 2019-11-27. Score: 0 | Accepted answer

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


---

### Answer by username_1 on 2019-11-22. Score: 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.

> **Comments:**
> **username_0**: Thanks, how do I move the bitcoin into the main balance so I can run sendtoaddress without an account argument?  
> **username_0**: Also, when I use `listaccounts` there is only one account, so I'm not sure why there are 2 separate balances  
> **username_1**: 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. https://bitcoin.org/en/release/v0.17.0#configuration-sections-for-testnet-and-regtest  

---

