aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-06-13 16:27:41 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-06-14 08:56:01 +0200
commitafcd77e17936f7ec9bbf7b47f55a211eccc08364 (patch)
treeaa6eec9a2994cf365b4140097adc09ed80e165d3 /src/wallet/wallet.cpp
parent17c0131fad62bfc966da93b7e42c7f0e07948b51 (diff)
downloadbitcoin-afcd77e17936f7ec9bbf7b47f55a211eccc08364.tar.xz
Detect -usehd mismatches when wallet.dat already exists
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp7
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);