wallet: Explicitly say migratewallet on encrypted wallets is unsupported

This commit is contained in:
Andrew Chow
2022-11-29 16:05:51 -05:00
parent 88afc73ae0
commit 5e65a216d1
2 changed files with 4 additions and 3 deletions

View File

@@ -730,7 +730,9 @@ static RPCHelpMan migratewallet()
std::shared_ptr<CWallet> wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue;
EnsureWalletIsUnlocked(*wallet);
if (wallet->IsCrypted()) {
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: migratewallet on encrypted wallets is currently unsupported.");
}
WalletContext& context = EnsureWalletContext(request.context);