aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-04-29 17:00:24 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-11-04 12:10:23 -0500
commitbd7398cc6258c258e9f4411c50630ec4a552341b (patch)
tree210adf4d98bc95729d11c4bdd6ac367b37b14c95 /src/wallet/wallet.cpp
parent5f720544f34dedf75b063b962845fa8eca604514 (diff)
downloadbitcoin-bd7398cc6258c258e9f4411c50630ec4a552341b.tar.xz
wallet: have ScriptPubKeyMan::Upgrade check against the new version
Instead of using CanSupportFeature and relying on nWalletMaxVersion, take the new version we are upgrading to and use IsSupportedFeature with that and the previous wallet version.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 6b7d05fdf3..dc1365b0bb 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4120,7 +4120,7 @@ const CAddressBookData* CWallet::FindAddressBookEntry(const CTxDestination& dest
bool CWallet::UpgradeWallet(int version, bilingual_str& error, std::vector<bilingual_str>& warnings)
{
int prev_version = GetVersion();
- int nMaxVersion = version;
+ int& nMaxVersion = version;
if (nMaxVersion == 0) // the -upgradewallet without argument case
{
WalletLogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
@@ -4146,7 +4146,7 @@ bool CWallet::UpgradeWallet(int version, bilingual_str& error, std::vector<bilin
}
for (auto spk_man : GetActiveScriptPubKeyMans()) {
- if (!spk_man->Upgrade(prev_version, error)) {
+ if (!spk_man->Upgrade(prev_version, version, error)) {
return false;
}
}