What is the simplest command I could use to test that my wallet unlocking process works properly?

1

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?

electrotype

Posted 2019-10-21T00:35:21.143

Reputation: 151

Answers

2

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.

Andrew Chow

Posted 2019-10-21T00:35:21.143

Reputation: 40 910