Browse Source

Move SetMinVersion for FEATURE_HD to SetHDMasterKey

Github-Pull: #8378
Rebased-From: 6523fcaab2
0.13
Patrick Strateman 8 years ago committed by Wladimir J. van der Laan
parent
commit
ebea65121e
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/wallet/wallet.cpp

6
src/wallet/wallet.cpp

@ -1170,6 +1170,9 @@ bool CWallet::SetHDMasterKey(const CKey& key)
{ {
LOCK(cs_wallet); LOCK(cs_wallet);
// ensure this wallet.dat can only be opened by clients supporting HD
SetMinVersion(FEATURE_HD);
// store the key as normal "key"/"ckey" object // store the key as normal "key"/"ckey" object
// in the database // in the database
// key metadata is not required // key metadata is not required
@ -3299,9 +3302,6 @@ bool CWallet::InitLoadWallet()
key.MakeNewKey(true); key.MakeNewKey(true);
if (!walletInstance->SetHDMasterKey(key)) if (!walletInstance->SetHDMasterKey(key))
throw std::runtime_error("CWallet::GenerateNewKey(): Storing master key failed"); throw std::runtime_error("CWallet::GenerateNewKey(): Storing master key failed");
// ensure this wallet.dat can only be opened by clients supporting HD
walletInstance->SetMinVersion(FEATURE_HD);
} }
CPubKey newDefaultKey; CPubKey newDefaultKey;
if (walletInstance->GetKeyFromPool(newDefaultKey)) { if (walletInstance->GetKeyFromPool(newDefaultKey)) {

Loading…
Cancel
Save