0

For my unit tests, I'd like to be able to delete and recreate a wallet without having to stop bitcoind and manually deleting the wallet directory.

When I try to delete such wallet directory without stopping bitcoind, I get an error since an handle exists on "db.log" (on Windows at least).

Is there a clean way to delete a (testnet) wallet without stopping bitcoind?

  • 2
    Why are you using testnet? Regtest mode exists explicitly for that purpose. – Anonymous Oct 21 at 10:09
  • Would bitcoind really allow me to delete a wallet when running on regtest? For some reason I doubt it would make any difference... I guess I should try! – electrotype Oct 21 at 13:47
  • Why do you want to? You can just restart the node. – Anonymous Oct 21 at 13:47
  • That is exactly what I try to avoid and why I ask this question in the first place! :-) – electrotype Oct 21 at 16:45
  • 1
    It takes seconds to restart a regtest node. Faster than whining on stack exhange about it. – Anonymous Oct 21 at 17:07
1

You can unload the wallet using unloadwallet and then delete the wallet file.

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.