mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-08 01:10:43 +02:00
walletdb: fix last client version update
The value was only being updated launching releases with higher version numbers and not if the user launched a previous release. Co-authored-by: MacroFake <falke.marco@gmail.com>
This commit is contained in:
@ -883,7 +883,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
||||
if (result != DBErrors::LOAD_OK)
|
||||
return result;
|
||||
|
||||
// Last client version to open this wallet, was previously the file version number
|
||||
// Last client version to open this wallet
|
||||
int last_client = CLIENT_VERSION;
|
||||
bool has_last_client = m_batch->Read(DBKeys::VERSION, last_client);
|
||||
pwallet->WalletLogPrintf("Wallet file version = %d, last client version = %d\n", pwallet->GetVersion(), last_client);
|
||||
@ -907,7 +907,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
||||
if (wss.fIsEncrypted && (last_client == 40000 || last_client == 50000))
|
||||
return DBErrors::NEED_REWRITE;
|
||||
|
||||
if (!has_last_client || last_client < CLIENT_VERSION) // Update
|
||||
if (!has_last_client || last_client != CLIENT_VERSION) // Update
|
||||
m_batch->Write(DBKeys::VERSION, CLIENT_VERSION);
|
||||
|
||||
if (wss.fAnyUnordered)
|
||||
|
Reference in New Issue
Block a user