Skip to content

Commit 4a3e8c5

Browse files
committed
Merge #13500: [wallet] Decouple wallet version from client version
cd3f4aa Decouple wallet version from client version (Andrew Chow) Pull request description: 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. Tree-SHA512: 69c3e1f45a40bde01d622d504a803fea32fc14e2e27b14b0729725349d8592d56ebca26fd06f117fd6f5164fb4ce980122751b6370f6e25f1a947dbdf4143ddd
2 parents b654723 + cd3f4aa commit 4a3e8c5

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
@@ -4025,7 +4025,7 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(const std::string& name,
40254025
if (nMaxVersion == 0) // the -upgradewallet without argument case
40264026
{
40274027
LogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
4028-
nMaxVersion = CLIENT_VERSION;
4028+
nMaxVersion = FEATURE_LATEST;
40294029
walletInstance->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately
40304030
}
40314031
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)