diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 9ca4d2da8bb..387568282da 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -1175,7 +1175,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet) return result; if (!has_last_client || last_client != CLIENT_VERSION) // Update - m_batch->Write(DBKeys::VERSION, CLIENT_VERSION); + this->WriteVersion(CLIENT_VERSION); if (any_unordered) result = pwallet->ReorderTransactions(); diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h index a867a28b970..788d44866a5 100644 --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -265,6 +265,9 @@ public: DBErrors LoadWallet(CWallet* pwallet); + //! Write the given client_version. + bool WriteVersion(int client_version) { return m_batch->Write(DBKeys::VERSION, CLIENT_VERSION); } + //! Delete records of the given types bool EraseRecords(const std::unordered_set& types);