[RPC] disable import functions in pruned mode
import functions could lead to a rescan beyond prune level
This commit is contained in:
parent
d510fb4aa4
commit
c4447e3df1
|
@ -99,6 +99,9 @@ UniValue importprivkey(const UniValue& params, bool fHelp)
|
|||
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
|
||||
);
|
||||
|
||||
if (fPruneMode)
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Importing keys is disabled in pruned mode");
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
@ -167,6 +170,9 @@ UniValue importaddress(const UniValue& params, bool fHelp)
|
|||
+ HelpExampleRpc("importaddress", "\"myaddress\", \"testing\", false")
|
||||
);
|
||||
|
||||
if (fPruneMode)
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Importing addresses is disabled in pruned mode");
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
CScript script;
|
||||
|
@ -265,6 +271,9 @@ UniValue importwallet(const UniValue& params, bool fHelp)
|
|||
|
||||
UniValue importwallet_impl(const UniValue& params, bool fHelp, bool fImportZKeys)
|
||||
{
|
||||
if (fPruneMode)
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Importing wallets is disabled in pruned mode");
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
@ -599,6 +608,9 @@ UniValue z_importkey(const UniValue& params, bool fHelp)
|
|||
+ HelpExampleRpc("z_importkey", "\"mykey\", \"no\"")
|
||||
);
|
||||
|
||||
if (fPruneMode)
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Importing keys is disabled in pruned mode");
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
|
Loading…
Reference in New Issue