mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Merge pull request #6057
7e6569e[squashme] improve/corrects prune mode detection test for required wallet rescans (Jonas Schnelli)7a12119[RPC] disable import functions in pruned mode (Jonas Schnelli)3201035[autoprune] allow wallet in pruned mode (Jonas Schnelli)
This commit is contained in:
@@ -94,6 +94,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();
|
||||
@@ -166,6 +169,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;
|
||||
@@ -236,6 +242,9 @@ UniValue importwallet(const UniValue& params, bool fHelp)
|
||||
+ HelpExampleRpc("importwallet", "\"test\"")
|
||||
);
|
||||
|
||||
if (fPruneMode)
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Importing wallets is disabled in pruned mode");
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
||||
Reference in New Issue
Block a user