diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-03-24 10:53:35 +0100 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-03-24 10:53:35 +0100 |
commit | 771a304ffe3c074a8ca1cdfb83d08379a5516e88 (patch) | |
tree | daf37632d79eb10336987f4a110c2a0cfea3f99d /src/wallet | |
parent | 1b3b5c6f8fa6aff93935319888bf0cfd242359dd (diff) | |
download | bitcoin-771a304ffe3c074a8ca1cdfb83d08379a5516e88.tar.xz |
Make sure we set the wallets min version to FEATURE_HD_SPLIT at the very first point
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 733afd49c1..0a06879754 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3682,13 +3682,14 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile) { // Create new keyUser and set as default key if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && !walletInstance->IsHDEnabled()) { + + // ensure this wallet.dat can only be opened by clients supporting HD with chain split + walletInstance->SetMinVersion(FEATURE_HD_SPLIT); + // generate a new master key CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey(); if (!walletInstance->SetHDMasterKey(masterPubKey)) throw std::runtime_error(std::string(__func__) + ": Storing master key failed"); - - // ensure this wallet.dat can only be opened by clients supporting HD with chain split - walletInstance->SetMinVersion(FEATURE_HD_SPLIT); } CPubKey newDefaultKey; if (walletInstance->GetKeyFromPool(newDefaultKey, false)) { |