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 Nov 8, 2019
1 parent 8df0f46 commit 0af7749
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 @@ -398,7 +398,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 0af7749

Please sign in to comment.