diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-09-12 12:44:23 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-09-12 12:40:41 +0200 |
commit | fadf31ef02b35f438ce2cf7048830f6974cdb515 (patch) | |
tree | e518bc88667f76e11f12e829525f8558b5d82d71 /src/wallet/wallet.cpp | |
parent | b9bceaf1c081a84d9fcc680372614e797b168a9e (diff) | |
download | bitcoin-fadf31ef02b35f438ce2cf7048830f6974cdb515.tar.xz |
wallet: Display non-HD error on first run
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d376de2337..cbc045fa18 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3827,6 +3827,10 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile) if (fFirstRun) { // ensure this wallet.dat can only be opened by clients supporting HD with chain split and expects no default key + if (!gArgs.GetBoolArg("-usehd", true)) { + InitError(strprintf(_("Error creating %s: You can't create non-HD wallets with this version."), walletFile)); + return nullptr; + } walletInstance->SetMinVersion(FEATURE_NO_DEFAULT_KEY); // generate a new master key @@ -3843,9 +3847,9 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile) walletInstance->SetBestChain(chainActive.GetLocator()); } else if (gArgs.IsArgSet("-usehd")) { - bool useHD = gArgs.GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET); + bool useHD = gArgs.GetBoolArg("-usehd", true); if (walletInstance->IsHDEnabled() && !useHD) { - InitError(strprintf(_("Error loading %s: You can't disable HD on an already existing HD wallet or create new non-HD wallets."), walletFile)); + InitError(strprintf(_("Error loading %s: You can't disable HD on an already existing HD wallet"), walletFile)); return nullptr; } if (!walletInstance->IsHDEnabled() && useHD) { |