Skip to content

Commit c318211

Browse files
furszyMacroFake
andcommitted
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 <[email protected]>
1 parent bda8ebe commit c318211

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/walletdb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
883883
if (result != DBErrors::LOAD_OK)
884884
return result;
885885

886-
// Last client version to open this wallet, was previously the file version number
886+
// Last client version to open this wallet
887887
int last_client = CLIENT_VERSION;
888888
bool has_last_client = m_batch->Read(DBKeys::VERSION, last_client);
889889
pwallet->WalletLogPrintf("Wallet file version = %d, last client version = %d\n", pwallet->GetVersion(), last_client);
@@ -907,7 +907,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
907907
if (wss.fIsEncrypted && (last_client == 40000 || last_client == 50000))
908908
return DBErrors::NEED_REWRITE;
909909

910-
if (!has_last_client || last_client < CLIENT_VERSION) // Update
910+
if (!has_last_client || last_client != CLIENT_VERSION) // Update
911911
m_batch->Write(DBKeys::VERSION, CLIENT_VERSION);
912912

913913
if (wss.fAnyUnordered)

0 commit comments

Comments
 (0)