Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 5,040 Lines • ▼ Show 20 Lines | static UniValue sethdseed(const Config &config, const JSONRPCRequest &request) { | ||||
} | } | ||||
if (IsInitialBlockDownload()) { | if (IsInitialBlockDownload()) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_CLIENT_IN_INITIAL_DOWNLOAD, | RPC_CLIENT_IN_INITIAL_DOWNLOAD, | ||||
"Cannot set a new HD seed while still in Initial Block 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"); | |||||
} | |||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
// Do not do anything to non-HD wallets | // Do not do anything to non-HD wallets | ||||
if (!pwallet->IsHDEnabled()) { | if (!pwallet->IsHDEnabled()) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_WALLET_ERROR, | RPC_WALLET_ERROR, | ||||
"Cannot set a HD seed on a non-HD wallet. Start with " | "Cannot set a HD seed on a non-HD wallet. Start with " | ||||
"-upgradewallet in order to upgrade a non-HD wallet to HD"); | "-upgradewallet in order to upgrade a non-HD wallet to HD"); | ||||
▲ Show 20 Lines • Show All 401 Lines • Show Last 20 Lines |