Can you reset 'used' addresses that were actually never used?

0

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?

pinhead

Posted 2016-02-05T23:33:51.353

Reputation: 2 356

Answers

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.

danda

Posted 2016-02-05T23:33:51.353

Reputation: 43