Do not import private keys to wallets with private keys disabled

This commit is contained in:
Andrew Chow
2019-01-25 14:38:34 -05:00
parent b5c5021b64
commit e6c58d3b01
4 changed files with 31 additions and 0 deletions
+4
View File
@@ -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);