mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
wallet: Explicitly say migratewallet on encrypted wallets is unsupported
This commit is contained in:
parent
88afc73ae0
commit
5e65a216d1
2 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -399,8 +399,7 @@ class WalletMigrationTest(BitcoinTestFramework):
|
|||
|
||||
wallet.encryptwallet("pass")
|
||||
|
||||
wallet.walletpassphrase("pass", 10)
|
||||
assert_raises_rpc_error(-4, "Error: Unable to produce descriptors for this legacy wallet. Make sure the wallet is unlocked first", wallet.migratewallet)
|
||||
assert_raises_rpc_error(-15, "Error: migratewallet on encrypted wallets is currently unsupported.", wallet.migratewallet)
|
||||
# TODO: Fix migratewallet so that we can actually migrate encrypted wallets
|
||||
|
||||
def run_test(self):
|
||||
|
|
Loading…
Reference in a new issue