I have create an account in bitcoind, which has got some balance of 1.77 btc, I would like to send everything to another address that is an admin address, so is there any rpc method to send everything or need to do transaction fee calculation for this. If transaction fee calculation has to be done, please let me know the calcuation, this particualar func has to be impl in my backend for a platform.

  • Do you want to send everything in the account, or everything in the wallet? Accounts are deprecated and there may not be good support for doing anything related to them. Jun 5 '18 at 4:57
  • I want to send everything in an account. Jun 5 '18 at 5:33

I would highly recommend that you not use the accounts system as it is deprecated and has been removed for Bitcoin Core 0.17 and beyond. Furthermore, the way that you want to use the accounts system is not how it actually works. Accounts are only associated with addresses for receiving; for spending, when you "send from" an account, all that happens is the numbers for the account are deducted, not that addresses that were associated with the account for receiving are the ones actually used in the inputs.

To send everything from an account, just use the sendfrom command with the balance of the account. This will change the accounting entries so that that account is deducted however much you sent. Note that this will not necessarily choose the inputs that you think are associated with the account; it can choose any input in the wallet to create the transaction. However if you call getbalance <account>, you will see the account's balance be 0.

  • Are you sure this works? Where do transaction fees come from in this case? sendfrom doesn't have the subtractfeefromamount parameter like sendtoaddress. Do they come from another account, or what? Jun 6 '18 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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