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 <address>, 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.

  • What is your question? – Зелёный Jan 29 at 8:32
  • Sorry, my question was unclear, so in brief, I want to send bitcoins successfully – 西田龍 Jan 29 at 8:34
  • It is still unclear for me. Please read bitcoin.stackexchange.com/help/how-to-ask – Зелёный Jan 29 at 8:39
  • 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? – 西田龍 Jan 29 at 9:33
  • I've edited your question to include the relevant information from the comment. – Murch Jan 29 at 19:23
up vote 2 down vote accepted

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
  • $ bitcoin-cli -testnet getreceivedbyaddress mq7A3EUXa4eu3XUJeB2RjXyS75EzSkz4T2 0 => 0.00000000 it even says that the adress has nothing – 西田龍 Jan 29 at 9:52
  • Is your bitcoind fully synced? what the output of getinfo command? Also is this address owned by wallet of your bitcoind ? – Зелёный Jan 29 at 9:58
  • 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. – 西田龍 Jan 29 at 17:01

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

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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