I have only recently started playing with bitcoind (which is most likely the way I intend to use Bitcoin in my own software) and got rather confused with the "account" label when using the "listtransactions" command (see
https://bitcointalk.org/index.php?topic=66214.0).
After Pieter Wuille's help I was able to understand that the problem I was seeing was that the GUI displays account labels for Sent tx's that have been assigned to the "sent to" address whereas "listtransactions" only shows account labels for "sent" category tx's that have been assigned to the "from" address (or something at least close to that).
So in short you cannot in any easy way get the same output as you see in the Sent tab in the GUI from bitcoind. My proposal is to add an option to listtransactions so you can get the same output (both "account" output and filtering for "send" category tx's to be taken from the "sent to" address). Note of course this is an option and would by default be false.
The change is to the bitcoinrpc command listtransactions whose usage would become as follows:
listtransactions [account] [count=10] [from=0] [usesenttoaddresses=false]
When usesenttoaddresses is set true then the account mapping for "send" category tx's is to the sent to addr (rather than the current behaviour).
Link for suggested commit changes:
https://github.com/ciyam/bitcoin/commits/opt_use_sent_to_addr_for_accI don't have an environment set up for compiling Bitcoin (and am flat out doing other work) so for now I would be grateful for any comments or suggestions with the proposed change.
Cheers,
Ian.