aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-06-16 15:30:37 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2022-06-16 15:33:30 -0300
commitc318211ddd48d44dd81dded553afeee3bc41c89e (patch)
treead5fbc03e8d9246b4864a8b61f1ccc50e28a6d19 /src/wallet/walletdb.cpp
parentbda8ebe608e6572eaaf40cd28dab6954241c9b0d (diff)
downloadbitcoin-c318211ddd48d44dd81dded553afeee3bc41c89e.tar.xz
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>
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r--src/wallet/walletdb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index 2cedd62930..dedbc4ec49 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -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)