Skip to content

Commit

Permalink
HD Split: Avoid redundant upgrades
Browse files Browse the repository at this point in the history
This avoids repeaded upgrades when support for more multiple keyman references
is added in the next commit:
bitcoin#16341 (comment)
  • Loading branch information
achow101 committed Jan 6, 2020
1 parent d8bb31d commit 05e08b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/scriptpubkeyman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ bool LegacyScriptPubKeyMan::Upgrade(int prev_version, std::string& error)
hd_upgrade = true;
}
// Upgrade to HD chain split if necessary
if (m_storage.CanSupportFeature(FEATURE_HD_SPLIT)) {
if (m_storage.CanSupportFeature(FEATURE_HD_SPLIT) && hdChain.nVersion < 2 /* VERSION_HD_CHAIN_SPLIT */) {
WalletLogPrintf("Upgrading wallet to use HD chain split\n");
m_storage.SetMinVersion(FEATURE_PRE_SPLIT_KEYPOOL);
split_upgrade = FEATURE_HD_SPLIT > prev_version;
Expand Down

0 comments on commit 05e08b8

Please sign in to comment.