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?

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.