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/1BPMNDJqfgSx55x4fME26DtQDtBEtKiKuTAm I missing something with setaccount and sendfrom?