diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-07-19 12:14:07 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-07-19 12:14:09 +0200 |
commit | 24f117ef05f5b227438c8ba4739b82cac21de809 (patch) | |
tree | 6bcb595b0ed7a74f165c880e45d5b015701de27a /src/wallet | |
parent | fca1a415cec6b7655448ce8b30778784ab4c181e (diff) | |
parent | 3b38a6a96a955d7b0192ece6ddcc7d750e155d81 (diff) |
Merge #8366: [0.13] [Wallet] Ensure <0.13 clients can't open HD wallets
3b38a6a [Wallet] Ensure <0.13 clients can't open HD wallets (Jonas Schnelli)
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 3 | ||||
-rw-r--r-- | src/wallet/wallet.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4b6d98025d..a76085de30 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3299,6 +3299,9 @@ 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)) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index e9d669a7d1..3a3cb6d851 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -78,7 +78,8 @@ enum WalletFeature FEATURE_WALLETCRYPT = 40000, // wallet encryption FEATURE_COMPRPUBKEY = 60000, // compressed public keys - FEATURE_LATEST = 60000 + FEATURE_HD = 130000, // Hierarchical key derivation after BIP32 (HD Wallet) + FEATURE_LATEST = FEATURE_COMPRPUBKEY // HD is optional, use FEATURE_COMPRPUBKEY as latest version }; |