aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-01-25 14:38:34 -0500
committerAndrew Chow <achow101-github@achow101.com>2019-01-31 14:29:28 -0500
commite6c58d3b014ab8ef5cca4be68764af4b79685fcb (patch)
tree9039a4523e7f7f6035271a849c0385e2e3c18dfe /src/wallet/rpcwallet.cpp
parentb5c5021b644731d14a6ef04961320a99466f035a (diff)
downloadbitcoin-e6c58d3b014ab8ef5cca4be68764af4b79685fcb.tar.xz
Do not import private keys to wallets with private keys disabled
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 5e036eb5df..859681d829 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -3830,6 +3830,10 @@ UniValue sethdseed(const JSONRPCRequest& request)
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Cannot set a new HD seed while still in Initial Block Download");
}
+ if (pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
+ throw JSONRPCError(RPC_WALLET_ERROR, "Cannot set a HD seed to a wallet with private keys disabled");
+ }
+
auto locked_chain = pwallet->chain().lock();
LOCK(pwallet->cs_wallet);