Author

Topic: Bitcoind setaccount/sendfrom issues (Read 690 times)

legendary
Activity: 4542
Merit: 3393
Vile Vixen and Miss Bitcointalk 2021-2023
June 04, 2014, 11:17:02 PM
#2
You're missing that accounts have nothing whatsoever to do with addresses. The only thing that setaccount does is causes coins sent to a particular address to be credited to a particular account instead of the default account. Coins sent from an account merely sends whatever coins are available, and deducts the amount from the account, which is what you would normally expect. After all, when you deposit cash in a bank account, you don't expect that the notes you later withdraw will be the exact same ones that you deposited, or get upset that somebody else withdraws "your" notes. If you expect anything else, you don't understand how accounts work and shouldn't be using them (you probably shouldn't be using them anyway, but for different reasons).
legendary
Activity: 3598
Merit: 2386
Viva Ut Vivas
June 04, 2014, 04:40:37 AM
#1
I have a list of public and private keys with associated public addresses I need to send bitcoins to.

To get this to work I do:
bitcoind getbalance testaccount
bitcoind importprivkey 5xyzabc.....
bitcoind setaccount 1xyzabc... testaccount
bitcoind getbalance testaccount
(if balance is higher by 'amount')
bitcoind sendfrom testaccount 1toaddress... 'amount'

When I ran this, it did not send from the right address:
bitcoind.exe getbalance test
Return: 0.00000000
bitcoind.exe importprivkey ....
bitcoind.exe setaccount  1BPMNDJqfgSx55x4fME26DtQDtBEtKiKuT test
bitcoind.exe getbalance test
Return: 1.00000000
bitcoind.exe sendfrom test 1Fbn8VVuUyejnPasPjjTdPXtQbutiyqxve 1.0

Here is the returned transaction ID:
184bd8b35e74f214e665b4cf101bc86f87aef0c81e7cdd6137a53c23cd2ad14e

You can see here that 1BPMNDJqfgSx55x4fME26DtQDtBEtKiKuT has not changed amount:
https://blockchain.info/address/1BPMNDJqfgSx55x4fME26DtQDtBEtKiKuT


Am I missing something with setaccount and sendfrom?
Jump to: