Skip to content

Commit cd3f4aa

Browse files
committed
Decouple wallet version from client version
Instead of comparing version numbers in the wallet to the client version number, compare them to the latest supported wallet version in the client. This allows for wallet version numbers to be unrelated to the client version number.
1 parent 0882406 commit cd3f4aa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4104,7 +4104,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(const std::string& name,
41044104
if (nMaxVersion == 0) // the -upgradewallet without argument case
41054105
{
41064106
LogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
4107-
nMaxVersion = CLIENT_VERSION;
4107+
nMaxVersion = FEATURE_LATEST;
41084108
walletInstance->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately
41094109
}
41104110
else

src/wallet/walletdb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
537537
int nMinVersion = 0;
538538
if (m_batch.Read((std::string)"minversion", nMinVersion))
539539
{
540-
if (nMinVersion > CLIENT_VERSION)
540+
if (nMinVersion > FEATURE_LATEST)
541541
return DBErrors::TOO_NEW;
542542
pwallet->LoadMinVersion(nMinVersion);
543543
}
@@ -640,7 +640,7 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::vector<CW
640640
int nMinVersion = 0;
641641
if (m_batch.Read((std::string)"minversion", nMinVersion))
642642
{
643-
if (nMinVersion > CLIENT_VERSION)
643+
if (nMinVersion > FEATURE_LATEST)
644644
return DBErrors::TOO_NEW;
645645
}
646646

0 commit comments

Comments
 (0)