<p>afaik, there isn't.  If the wallets are just for testing, you could remove wallet.dat periodically and start over.  I guess the main reason for doing this would be if you are doing automated testing with tens of thousands to millions of addresses being created and it starts to slow performance significantly.</p>

<p>or you could always hack bitcoind and modify getnewaddress to return the first available address without any balance.  Or create a new API for this.</p>

CC BY-SA 3.0
2016-02-06T00:28:04.787Z
2016-02-06T00:28:04.787Z
danda
<p>Bitcoin RPC command <code>getnewaddress</code> returns a P2PKH address from the keypool, and marks it as "used" so it will not be returned by the same RPC call again.</p>

<p>I'm going to be doing a lot of testing on that RPC command but will not actually send any money to those addresses - is there a way to "reset" the status of addresses in bitcoind's wallet?</p>

<wallet><json-rpc><address-generation>
Can you reset 'used' addresses that were actually never used?
pinhead
# Can you reset 'used' addresses that were actually never used?

(Asked by: username_0 on 2016-02-05)

Bitcoin RPC command `getnewaddress` returns a P2PKH address from the keypool, and marks it as "used" so it will not be returned by the same RPC call again.

I'm going to be doing a lot of testing on that RPC command but will not actually send any money to those addresses - is there a way to "reset" the status of addresses in bitcoind's wallet?

**Tags:** wallet, json-rpc, address-generation


---

## 1 answers

### Answer by username_1 on 2016-02-06. Score: 1

afaik, there isn't. If the wallets are just for testing, you could remove wallet.dat periodically and start over. I guess the main reason for doing this would be if you are doing automated testing with tens of thousands to millions of addresses being created and it starts to slow performance significantly.

or you could always hack bitcoind and modify getnewaddress to return the first available address without any balance. Or create a new API for this.


---

