Working on setting up a new home server on Ubuntu 11.10, and wanted to build bitcoind from source. Ended up with the 0.6 code (didn't realize this until later). Anyways, had fun playing with the import feature (I was banging my head about how to do this in 0.5.2).
As mentioned by another user, the import took a while. Would it be worth considering threading this off in order to make the user experience a little nicer?
There seems to be something crossed in the getaccountaddress and getnewaddress RPC calls. I generated a throwaway address at bitcionaddress.com for this demonstration (and masked it to keep anyone from accidentally using it):
Bitcoin Address: 1XXXXX7zMGHrs7oc1hCSwkNCmmfT8m2mSQ
Private Key: 5JMn6mZwW69NXXXXXXXXXXXXXXXXEgzyjD9NvywV3CzuVUT18wq
Then, I imported it, then got the list of accounts. It's there!
me@chewy:~$ bitcoind importprivkey 5JMn6mZwW69NXXXXXXXXXXXXXXXXEgzyjD9NvywV3CzuVUT18wq Garbage
me@chewy:~$ bitcoind listaccounts
{
"" : 0.00000000,
"Garbage" : 0.00000000,
"Prayer" : 0.14000000,
"Test" : 0.00000000,
"dunno" : 0.00000000
}
However, when I tried to verify the address on the imported key, it seems to have generated a new key/address pair:
me@chewy:~$ bitcoind getaccountaddress Garbage
1ZZZZZpXRbgb9dn3bfbwZb9YDKieqgnNaZ
Subsequent calls to getaccountaddress return the same address (no new addresses are generated). However, you can verify that the 'account' now has two addresses associated with it:
me@chewy:~$ bitcoind getaddressesbyaccount Garbage
[
"1XXXXX7zMGHrs7oc1hCSwkNCmmfT8m2mSQ",
"1ZZZZZpXRbgb9dn3bfbwZb9YDKieqgnNaZ"
]
Having an extra address generated isn't a big deal, but I never asked for a new address to be generated.
I started looking into the code, but I'm not familiar enough yet to figure out what's going on. I may play around with it tonight and see if I can figure out a fix, but it's been years since I've even looked at c++ and even then it wasn't much.
Also, if I may... shouldn't the client be able to refresh the wallet when a key has been imported? It's rather annoying to have to stop/restart when importing a key before it shows up in the GUI. Maybe this would be an argument for splitting server & client functionality, and use the GUI only to make RPC calls against the server.
Now, if my observations are worth anything, the address in my sig is valid. I only have like .14 BTC now and want a bit more to play with =D.