You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (found && !chain.hasBlocks(tip_hash, height)) {
108
+
throwJSONRPCError(RPC_WALLET_ERROR, strprintf("Pruned blocks from height %d required to import keys. Use RPC call getblockchaininfo to determine your pruned height.", height));
109
+
}
110
+
}
111
+
96
112
RPCHelpMan importprivkey()
97
113
{
98
114
return RPCHelpMan{"importprivkey",
@@ -504,13 +520,6 @@ RPCHelpMan importwallet()
504
520
505
521
EnsureLegacyScriptPubKeyMan(*pwallet, true);
506
522
507
-
if (pwallet->chain().havePruned()) {
508
-
// Exit early and print an error.
509
-
// If a block is pruned after this check, we will import the key(s),
510
-
// but fail the rescan with a generic error.
511
-
throwJSONRPCError(RPC_WALLET_ERROR, "Importing wallets is disabled when blocks are pruned");
512
-
}
513
-
514
523
WalletRescanReserver reserver(*pwallet);
515
524
if (!reserver.reserve()) {
516
525
throwJSONRPCError(RPC_WALLET_ERROR, "Wallet is currently rescanning. Abort existing rescan or wait.");
0 commit comments