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.
This commit is contained in:
Andrew Chow
2020-04-29 17:00:24 -04:00
parent 5f720544f3
commit bd7398cc62
3 changed files with 7 additions and 7 deletions

View File

@@ -206,7 +206,7 @@ public:
virtual bool CanGetAddresses(bool internal = false) const { return false; }
/** Upgrades the wallet to the specified version */
virtual bool Upgrade(int prev_version, bilingual_str& error) { return false; }
virtual bool Upgrade(int prev_version, int new_version, bilingual_str& error) { return false; }
virtual bool HavePrivateKeys() const { return false; }
@@ -371,7 +371,7 @@ public:
bool SetupGeneration(bool force = false) override;
bool Upgrade(int prev_version, bilingual_str& error) override;
bool Upgrade(int prev_version, int new_version, bilingual_str& error) override;
bool HavePrivateKeys() const override;