JSON-RPC problem with Bitcoin-Qt 0.8.5 I am running bitcoin-qt v0.8.5 on Linux/amd64 and I encounter a strange behaviour for account commands when using JSON-RPC.

My initial wallet looks like this:

Test-Account | 1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB


After issuing the command

setaccount '1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB' 'Renamed Account'


I just expected the old account to be renamed, but the wallet changes to:

Renamed Account | 1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB
Test-Account    | 16jfcbLM9tGrkvXqGKnuC46j2jqKVMAe46


It created a new address for the old account (it is always the same new address for the same old address !?). Is that behaviour intended? The documentation I could find is unconclusive about that.

After this I issued the command

getaccountaddress 'Renamed Account'


and I expected to get the address "1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB" as a result. But instead I got the single address "176uhGVRT8KxScvQqdA7Yh87qQ8F5LMMM6" - and the wallet now looks like:

Renamed Account | 1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB
Renamed Account | 176uhGVRT8KxScvQqdA7Yh87qQ8F5LMMM6
Test-Account    | 16jfcbLM9tGrkvXqGKnuC46j2jqKVMAe46


What is happening here? What am I doing wrong?
From the Accounts wiki page:


getaccountaddress will return the same address until coins are received on that address; once coins have been received, it will generate and return a new address.
getnewaddress always generates and returns a new address.
setaccount changes the account associated with an existing address. Coins previously received on that address (if any) will be debited from the previous account's balance and credited to the address' new account. Note that doing so may make the previous account's balance negative.


Use the getaddressesbyaccount method to list all addresses associated with an account.