Skip to content

Commit 6523fca

Browse files
committed
Move SetMinVersion for FEATURE_HD to SetHDMasterKey
1 parent 045106b commit 6523fca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,9 @@ bool CWallet::SetHDMasterKey(const CKey& key)
11701170
{
11711171
LOCK(cs_wallet);
11721172

1173+
// ensure this wallet.dat can only be opened by clients supporting HD
1174+
SetMinVersion(FEATURE_HD);
1175+
11731176
// store the key as normal "key"/"ckey" object
11741177
// in the database
11751178
// key metadata is not required
@@ -3299,9 +3302,6 @@ bool CWallet::InitLoadWallet()
32993302
key.MakeNewKey(true);
33003303
if (!walletInstance->SetHDMasterKey(key))
33013304
throw std::runtime_error("CWallet::GenerateNewKey(): Storing master key failed");
3302-
3303-
// ensure this wallet.dat can only be opened by clients supporting HD
3304-
walletInstance->SetMinVersion(FEATURE_HD);
33053305
}
33063306
CPubKey newDefaultKey;
33073307
if (walletInstance->GetKeyFromPool(newDefaultKey)) {

0 commit comments

Comments
 (0)