1
I have small amounts in multiple accounts in the same wallet. I want to send all of them to default account (usually named as ""). Is their any RPC command available for this scenario?
Thanks in advance
1
I have small amounts in multiple accounts in the same wallet. I want to send all of them to default account (usually named as ""). Is their any RPC command available for this scenario?
Thanks in advance
0
NOTE: Account features are deprecated and will be removed in Bitcoin Core v0.18.0, it is recommended to switch to the label API in v0.17.0 and later, see Release notes 14023.
Depending on what you are trying to do, you can either move them using the move RPC:
move "fromaccount" "toaccount" amount ( minconf "comment" )
DEPRECATED. Move a specified amount from one account in your wallet to another.
Arguments:
1. "fromaccount" (string, required) The name of the account to move funds from. May be the default account using "".
2. "toaccount" (string, required) The name of the account to move funds to. May be the default account using "".
3. amount (numeric) Quantity of BTC to move between accounts.
4. (dummy) (numeric, optional) Ignored. Remains for backward compatibility.
5. "comment" (string, optional) An optional comment, stored in the wallet only.
Result: true|false (boolean) true if successful.
Examples:
Move 0.01 BTC from the default account to the account named tabby
> bitcoin-cli move "" "tabby" 0.01
Move 0.01 BTC timotei to akiko with a comment and funds have 6 confirmations
> bitcoin-cli move "timotei" "akiko" 0.01 6 "happy birthday!"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["timotei", "akiko",
0.01, 6, "happy birthday!"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
Or you can get the address of the default account using the getaccountaddress RPC:
$ bitcoin-cli getaccountaddress ""
and then send it to that address using the sendfrom RPC:
$ bitcoin-cli sendfrom <account-name> <to-address> <amount>
This command will allow only one to one tx... I am looking for many to one tx. – Madhu Crypto – 2018-09-29T12:43:05.230
You can create it manually and use the
sendrawtransactionrpc. I think if you usesendtoaddressand send the full amount, it will pull from multiple accounts, but the accounts feature doesn't work like you expect and the Bitcoin won't update the account balance. – JBaczuk – 2018-09-29T13:47:40.823JBaczuk, what is the best method you suggest to send small amounts from multiple addresses to default one address (account name - "")? All addresses in the same wallet – Madhu Crypto – 2018-09-29T14:04:42.183
Honestly I would avoid the accounts features, they are confusing. You will move the funds to the address associated with the default account ("") and it won't reflect that when you
listaccountseven though it has been sent to that address. Sorry I don't really have a good suggestion for using the Bitcoin Core wallet, but there are many other wallet implementations that would probably be better for this. – JBaczuk – 2018-09-29T14:17:30.393