@@ -45,7 +45,7 @@ RPCHelpMan walletpassphrase()
4545 {
4646 LOCK (pwallet->cs_wallet );
4747
48- if (!pwallet->IsCrypted ()) {
48+ if (!pwallet->HasEncryptionKeys ()) {
4949 throw JSONRPCError (RPC_WALLET_WRONG_ENC_STATE, " Error: running with an unencrypted wallet, but walletpassphrase was called." );
5050 }
5151
@@ -134,7 +134,7 @@ RPCHelpMan walletpassphrasechange()
134134 std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest (request);
135135 if (!pwallet) return UniValue::VNULL;
136136
137- if (!pwallet->IsCrypted ()) {
137+ if (!pwallet->HasEncryptionKeys ()) {
138138 throw JSONRPCError (RPC_WALLET_WRONG_ENC_STATE, " Error: running with an unencrypted wallet, but walletpassphrasechange was called." );
139139 }
140140
@@ -199,7 +199,7 @@ RPCHelpMan walletlock()
199199 std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest (request);
200200 if (!pwallet) return UniValue::VNULL;
201201
202- if (!pwallet->IsCrypted ()) {
202+ if (!pwallet->HasEncryptionKeys ()) {
203203 throw JSONRPCError (RPC_WALLET_WRONG_ENC_STATE, " Error: running with an unencrypted wallet, but walletlock was called." );
204204 }
205205
@@ -256,7 +256,7 @@ RPCHelpMan encryptwallet()
256256 throw JSONRPCError (RPC_WALLET_ENCRYPTION_FAILED, " Error: wallet does not contain private keys, nothing to encrypt." );
257257 }
258258
259- if (pwallet->IsCrypted ()) {
259+ if (pwallet->HasEncryptionKeys ()) {
260260 throw JSONRPCError (RPC_WALLET_WRONG_ENC_STATE, " Error: running with an encrypted wallet, but encryptwallet was called." );
261261 }
262262
0 commit comments