Merge #8378: [Wallet]Move SetMinVersion for FEATURE_HD to SetHDMasterKey

6523fca Move SetMinVersion for FEATURE_HD to SetHDMasterKey (Patrick Strateman)
This commit is contained in:
Wladimir J. van der Laan 2016-07-20 11:57:22 +02:00
commit 8e048f40cc
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -1170,6 +1170,9 @@ bool CWallet::SetHDMasterKey(const CKey& key)
{
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
// in the database
// key metadata is not required
@ -3299,9 +3302,6 @@ bool CWallet::InitLoadWallet()
key.MakeNewKey(true);
if (!walletInstance->SetHDMasterKey(key))
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;
if (walletInstance->GetKeyFromPool(newDefaultKey)) {