What is the bitcoind command to send all coins to another address?

12

2

I'm running bitcoind and I want to send all my coins to another address. What is the command for this?

Patoshi パトシ

Posted 2014-01-06T21:31:34.290

Reputation: 8 911

Answers

21

To be strict, OP asked to send all coins, which @mschuett didn't answer.

The key thing to do this is the last optional bool argument of the sendtoaddress RPC command called subtractfeefromamount. The way to use it is:

bitcoin-cli walletpassphrase <passphrase> <timeoutInSeconds>
bitcoin-cli sendtoaddress <bitcoinaddress> `bitcoin-cli getbalance` "" "" true

knocte

Posted 2014-01-06T21:31:34.290

Reputation: 1 531

4

This command:

sendtoaddress <bitcoinaddress> <amount>

will do the trick.

Look at the bitcoind api for more info: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

mschuett

Posted 2014-01-06T21:31:34.290

Reputation: 384