File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ bool CWallet::ActivateSaplingWallet(bool memOnly)
8686{
8787 if (m_sspk_man->SetupGeneration (m_spk_man->GetHDChain ().GetID (), true , memOnly)) {
8888 LogPrintf (" %s : sapling spkm setup completed\n " , __func__);
89+ // Just to be triple sure, if the version isn't updated, set it.
90+ if (!SetMinVersion (WalletFeature::FEATURE_SAPLING)) {
91+ LogPrintf (" %s : ERROR: wallet cannot upgrade to sapling features. Try to upgrade using the 'upgradewallet' RPC command\n " , __func__);
92+ return false ;
93+ }
8994 return true ;
9095 }
9196 return false ;
@@ -4002,7 +4007,8 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
40024007
40034008 // Forced upgrade
40044009 const bool fLegacyWallet = gArgs .GetBoolArg (" -legacywallet" , false );
4005- if (gArgs .GetBoolArg (" -upgradewallet" , fFirstRun && !fLegacyWallet )) {
4010+ if (gArgs .GetBoolArg (" -upgradewallet" , fFirstRun && !fLegacyWallet ) ||
4011+ (!walletInstance->IsLocked () && prev_version == FEATURE_PRE_SPLIT_KEYPOOL)) {
40064012 if (prev_version <= FEATURE_PRE_PIVX && walletInstance->IsLocked ()) {
40074013 // Cannot upgrade a locked wallet
40084014 UIError (" Cannot upgrade a locked wallet." );
You can’t perform that action at this time.
0 commit comments