diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-06-13 16:27:41 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-06-14 08:56:01 +0200 |
commit | afcd77e17936f7ec9bbf7b47f55a211eccc08364 (patch) | |
tree | aa6eec9a2994cf365b4140097adc09ed80e165d3 /src | |
parent | 17c0131fad62bfc966da93b7e42c7f0e07948b51 (diff) |
Detect -usehd mismatches when wallet.dat already exists
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 1c212d0147..a4ffdfdb52 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3236,6 +3236,13 @@ bool CWallet::InitLoadWallet() walletInstance->SetBestChain(chainActive.GetLocator()); } + else if (mapArgs.count("-usehd")) { + bool useHD = GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET); + if (!walletInstance->hdChain.masterKeyID.IsNull() && !useHD) + return InitError(strprintf(_("Error loading %s: You can't disable HD on a already existing HD wallet"), walletFile)); + if (walletInstance->hdChain.masterKeyID.IsNull() && useHD) + return InitError(strprintf(_("Error loading %s: You can't enable HD on a already existing non-HD wallet"), walletFile)); + } LogPrintf(" wallet %15dms\n", GetTimeMillis() - nStart); |