Coins: Add kHeader to CDBBatch::size_estimate

The initialization of the manual `size_estimate` in `CDBBatch::Clear()` is corrected from `0` to `kHeader` (LevelDB's fixed batch header size).
This aligns the manual estimate with LevelDB's actual size immediately after clearing, fixing discrepancies that would otherwise be caught by tests in the next commit (e.g., `coins_tests`, `validation_chainstatemanager_tests`).
This commit is contained in:
Lőrinc
2025-04-01 15:46:23 +02:00
parent 0dc74c92c0
commit 751077c6e2
2 changed files with 8 additions and 2 deletions

View File

@@ -75,6 +75,8 @@ class CDBBatch
friend class CDBWrapper;
private:
static constexpr size_t kHeader{12}; // See: src/leveldb/db/write_batch.cc#L27
const CDBWrapper &parent;
struct WriteBatchImpl;