diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-01-25 14:38:34 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-01-31 14:29:28 -0500 |
commit | e6c58d3b014ab8ef5cca4be68764af4b79685fcb (patch) | |
tree | 9039a4523e7f7f6035271a849c0385e2e3c18dfe /src/wallet/rpcwallet.cpp | |
parent | b5c5021b644731d14a6ef04961320a99466f035a (diff) |
Do not import private keys to wallets with private keys disabled
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r-- | src/wallet/rpcwallet.cpp | 4 |
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); |