I simply want to unit test that my lock/unlock process works well on an encrypted wallet.

What would be the easiest command I could send (that doesn't involve sending coins) to actually validate if my wallet is locked or unlocked? Can I try to sign a dummy transaction for example?


You can sign a message using the signmessage command. Note that this only works if you are using legacy addresses (Bitcoin Core currently defaults to p2sh-segwit addresses which cannot be used to sign a message). You an get a legacy address using:

bitcoin-cli getnewaddres "" legacy

If the wallet is locked, you won't be able to sign a message.

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.