<p>From the <a href="https://en.bitcoin.it/wiki/Accounts_explained#Accounts_and_Receiving_Addresses" rel="nofollow">Accounts wiki page</a>:</p>

<ul>
<li><code>getaccountaddress</code> 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.</li>
<li><code>getnewaddress</code> always generates and returns a new address.</li>
<li><code>setaccount</code> 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.</li>
</ul>

<p>Use the <code>getaddressesbyaccount</code> method to list all addresses associated with an account.</p>

CC BY-SA 3.0
2013-10-17T13:32:21.737Z
2013-10-17T13:32:21.737Z
Colin Dean
<p>I am running bitcoin-qt v0.8.5 on Linux/amd64 and I encounter a strange behaviour for account commands when using JSON-RPC.</p>

<p>My initial wallet looks like this:</p>

<pre><code>Test-Account | 1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB
</code></pre>

<p>After issuing the command</p>

<pre><code>setaccount '1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB' 'Renamed Account'
</code></pre>

<p>I just expected the old account to be renamed, but the wallet changes to:</p>

<pre><code>Renamed Account | 1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB
Test-Account    | 16jfcbLM9tGrkvXqGKnuC46j2jqKVMAe46
</code></pre>

<p>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.</p>

<p>After this I issued the command</p>

<pre><code>getaccountaddress 'Renamed Account'
</code></pre>

<p>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:</p>

<pre><code>Renamed Account | 1PNU1vZbruMCZpVBFk3eKmKrfGKDugBsjB
Renamed Account | 176uhGVRT8KxScvQqdA7Yh87qQ8F5LMMM6
Test-Account    | 16jfcbLM9tGrkvXqGKnuC46j2jqKVMAe46
</code></pre>

<p>What is happening here? What am I doing wrong?</p>

<json-rpc>
JSON-RPC problem with Bitcoin-Qt 0.8.5
user7134
# JSON-RPC problem with Bitcoin-Qt 0.8.5

(Asked by: username_0 on 2013-10-17)

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?

**Tags:** json-rpc


---

## 1 answers

### Answer by username_1 on 2013-10-17. Score: 1

From the [Accounts wiki page](https://en.bitcoin.it/wiki/Accounts_explained#Accounts_and_Receiving_Addresses):

* `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.


---

