diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-04-24 21:42:51 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-05-28 09:00:45 +0200 |
commit | 7a12119d7a9084010725cf5b95bafcc3cf2c1d71 (patch) | |
tree | 652f8afa457ec24410d3a3650e030d1d3018fb3b /src/wallet | |
parent | 3201035f22fe451c808b0bb157d33a58f0d99c07 (diff) |
[RPC] disable import functions in pruned mode
import functions could lead to a rescan beyond prune level
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/rpcdump.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index ab951d1d7d..b8fb0675ed 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -95,6 +95,9 @@ Value importprivkey(const Array& 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 @@ Value importaddress(const Array& 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; @@ -237,6 +243,9 @@ Value importwallet(const Array& 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(); |