mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 18:52:29 +02:00
refactor: Let CCoinsViewCache::BatchWrite return void
CCoinsViewCache::BatchWrite always returns true if called from a backed cache, so just return void instead. Also return void from ::Sync and ::Flush. This allows for dropping a FatalError condition and simplifying some dead error handling code a bit. Since we now no longer exercise the "error path" when returning from `CCoinsView::BatchWrite`, make the method clear the cache instead. This should only be exercised by tests and not change production behaviour. This might slightly improve the coins_view fuzz test's ability to generate better coverage. Co-authored-by: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
@@ -44,7 +44,7 @@ public:
|
||||
bool HaveCoin(const COutPoint &outpoint) const override;
|
||||
uint256 GetBestBlock() const override;
|
||||
std::vector<uint256> GetHeadBlocks() const override;
|
||||
bool BatchWrite(CoinsViewCacheCursor& cursor, const uint256 &hashBlock) override;
|
||||
void BatchWrite(CoinsViewCacheCursor& cursor, const uint256& hashBlock) override;
|
||||
std::unique_ptr<CCoinsViewCursor> Cursor() const override;
|
||||
|
||||
//! Whether an unsupported database format is used.
|
||||
|
||||
Reference in New Issue
Block a user