aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Strateman <[email protected]>2016-07-19 22:30:17 -0700
committerPatrick Strateman <[email protected]>2016-07-19 22:30:17 -0700
commit6523fcaab2f0808d4e47b9cb9ebbef7ed69a309e (patch)
treec33fec039208ea70fe55cdbd4b074bf8dcbac32f /src
parentMerge #8367: [Wallet] Ensure <0.13 clients can't open HD wallets (diff)
downloaddiscoin-6523fcaab2f0808d4e47b9cb9ebbef7ed69a309e.tar.xz
discoin-6523fcaab2f0808d4e47b9cb9ebbef7ed69a309e.zip
Move SetMinVersion for FEATURE_HD to SetHDMasterKey
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index a76085de3..5908dfeac 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -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)) {