aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-11-29 16:05:51 -0500
committerfanquake <fanquake@gmail.com>2022-12-01 10:22:14 +0000
commit95fded106979a523431863679107810db81ca4b3 (patch)
treee161de6b977c240b5d816c0f8d19850d11085e1a /src
parentd464b2af30f2b02be2ce0b5e45dc6c141529dba5 (diff)
downloadbitcoin-95fded106979a523431863679107810db81ca4b3.tar.xz
wallet: Explicitly say migratewallet on encrypted wallets is unsupported
Github-Pull: #26594 Rebased-From: 5e65a216d1fd00c447757736d4f2899d235e731a
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpc/wallet.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp
index 675c4a759d..971814e9cd 100644
--- a/src/wallet/rpc/wallet.cpp
+++ b/src/wallet/rpc/wallet.cpp
@@ -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);