mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
wallet: WalletBatch->WriteVersion respect argument.
Previously would use global `CLIENT_VERSION` no matter what, but this is one sense a refactor since all of the places where WriteVersion is called currently call it with `CLIENT_VERSION` anyways. The `client_version` argument is kept since future test code may want to write other versions. Addresses a review comment from #32636: https://github.com/bitcoin/bitcoin/pull/32636#discussion_r2356299627
This commit is contained in:
@@ -271,8 +271,14 @@ public:
|
||||
|
||||
DBErrors LoadWallet(CWallet* pwallet);
|
||||
|
||||
//! Write the given client_version.
|
||||
bool WriteVersion(int client_version) { return m_batch->Write(DBKeys::VERSION, CLIENT_VERSION); }
|
||||
/**
|
||||
* Write the given `client_version` to m_batch, indicating the last version
|
||||
* of client software to load this wallet.
|
||||
*
|
||||
* @param[in] client_version `CLIENT_VERSION` outside of test code.
|
||||
* @return A bool indicating whether or not the write succeeded.
|
||||
*/
|
||||
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<std::string>& types);
|
||||
|
||||
Reference in New Issue
Block a user