<p><strong>You can query the balance only of address you own.</strong></p>

<blockquote>
  <p>I sent bitcoins to an address and blockcypher says the transaction has
  done but as I try to know the balance using <code>bitcoin-cli -testnet getbalance the address</code>, the address hasn't received yet.So why
  couldn't the address receive bitcoins or couldn't I send ?</p>
</blockquote>

<p>The <a href="https://bitcoin.org/en/developer-reference#getbalance" rel="nofollow noreferrer"><code>getbalance</code></a> RPC method(and related <code>bitcoin-cli</code> command) accept two arguments, first is a string and it isn't an address, it's an account name, second is a confirmation coint To get the balance of whole wallet use: </p>

<pre><code>bitcoin-cli -testnet getbalance
</code></pre>

<p>Or use <a href="https://bitcoin.org/en/developer-reference#getreceivedbyaddress" rel="nofollow noreferrer"><code>getreceivedbyaddress</code></a>:</p>

<pre><code>bitcoin-cli -testnet getreceivedbyaddress 'the address' 0
</code></pre>

CC BY-SA 3.0
2018-01-29T09:52:27.853Z
`$  bitcoin-cli -testnet getreceivedbyaddress mq7A3EUXa4eu3XUJeB2RjXyS75EzSkz4T2 0
=> 0.00000000`
it even says that the adress has nothing
西田龍
CC BY-SA 3.0
2018-01-29T09:58:29.690Z
Is your bitcoind fully synced? what the output of `getinfo` command? Also is this address owned by wallet of your bitcoind ?
Roman Kiselenko
CC BY-SA 3.0
2018-01-29T17:01:32.650Z
It was synced completely.Thank you, I just found that the address wasn't valid so that I couldn't make my wallet have the address then it said the address has nothing.
西田龍
CC BY-SA 3.0
2018-01-29T09:40:36.943Z
2018-01-29T10:11:46.587Z
2018-01-29T10:11:46.587Z
Roman Kiselenko
<p>make sure you are passing the account name as first parameter. If no account name is passed it will show you the balance of all the address in that wallet</p>

CC BY-SA 3.0
2018-01-29T10:07:29.820Z
2018-01-29T10:07:29.820Z
Support Blockchain
<p>I sent bitcoins to an address and blockcypher says the transaction is done but as I try to learn the balance using  <code>bitcoin-cli -testnet getbalance &lt;address&gt;</code>, the address hasn't received yet. So why can't the address receive bitcoins even now?</p>

<p>I really don't know why I can't get bitcoins.</p>

<p>Obviously, as blockcypher says I sent some bitcoins to the address from other my address and blockcypher says that the transactions were confirmed.</p>

CC BY-SA 3.0
2018-01-29T08:32:55.473Z
What is your question?
Roman Kiselenko
CC BY-SA 3.0
2018-01-29T08:34:12.410Z
Sorry, my question was unclear, so in brief, I want to send bitcoins successfully
西田龍
CC BY-SA 3.0
2018-01-29T08:39:49.113Z
It is still unclear for me. Please read https://bitcoin.stackexchange.com/help/how-to-ask
Roman Kiselenko
CC BY-SA 3.0
2018-01-29T09:33:18.803Z
I see. sorry I've read.
 so I sent bitcoins to an address and blockcypher says the transaction has done but as I try to know the balance using  `bitcoin-cli -testnet getbalance the address`, the address hasn't received yet.So why can't the address receive bitcoins even now?
西田龍
CC BY-SA 3.0
2018-01-29T19:23:09.503Z
I've edited your question to include the relevant information from the comment.
Murch
<transactions><bitcoin-core><bitcoind><unconfirmed-transactions>
The getbalance command shows an empty balance
西田龍
# The getbalance command shows an empty balance

(Asked by: username_0 on 2018-01-29)

I sent bitcoins to an address and blockcypher says the transaction is done but as I try to learn the balance using `bitcoin-cli -testnet getbalance` , the address hasn't received yet. So why can't the address receive bitcoins even now?

I really don't know why I can't get bitcoins.

Obviously, as blockcypher says I sent some bitcoins to the address from other my address and blockcypher says that the transactions were confirmed.

**Tags:** transactions, bitcoin-core, bitcoind, unconfirmed-transactions

> **Comments:**
> **username_1**: What is your question?  
> **username_0**: Sorry, my question was unclear, so in brief, I want to send bitcoins successfully  
> **username_1**: It is still unclear for me. Please read https://bitcoin.stackexchange.com/help/how-to-ask  
> **username_0**: I see. sorry I've read.  so I sent bitcoins to an address and blockcypher says the transaction has done but as I try to know the balance using  `bitcoin-cli -testnet getbalance the address`, the address hasn't received yet.So why can't the address receive bitcoins even now?  
> **username_2**: I've edited your question to include the relevant information from the comment.  

---

## 2 answers

### Answer by username_1 on 2018-01-29. Score: 3 | Accepted answer

You can query the balance only of address you own.

I sent bitcoins to an address and blockcypher says the transaction has
  done but as I try to know the balance using bitcoin-cli -testnet getbalance the address, the address hasn't received yet.So why
  couldn't the address receive bitcoins or couldn't I send ?

The getbalance RPC method(and related bitcoin-cli command) accept two arguments, first is a string and it isn't an address, it's an account name, second is a confirmation coint To get the balance of whole wallet use: 
bitcoin-cli -testnet getbalance

Or use getreceivedbyaddress:
bitcoin-cli -testnet getreceivedbyaddress 'the address' 0

> **Comments:**
> **username_0**: `$  bitcoin-cli -testnet getreceivedbyaddress mq7A3EUXa4eu3XUJeB2RjXyS75EzSkz4T2 0 => 0.00000000` it even says that the adress has nothing  
> **username_1**: Is your bitcoind fully synced? what the output of `getinfo` command? Also is this address owned by wallet of your bitcoind ?  
> **username_0**: It was synced completely.Thank you, I just found that the address wasn't valid so that I couldn't make my wallet have the address then it said the address has nothing.  

---

### Answer by username_3 on 2018-01-29. Score: -1

make sure you are passing the account name as first parameter. If no account name is passed it will show you the balance of all the address in that wallet


---

