mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-12 16:47:58 +02:00
refactor: inline constant return value of CDBWrapper::WriteBatch
`WriteBatch` can only ever return `true` - its errors are handled by throwing a `throw dbwrapper_error` instead. The boolean return value is quite confusing, especially since it's symmetric with `CDBWrapper::Read`, which catches the exceptions and returns a boolean instead. We're removing the constant return value and inlining `true` for its usages.
This commit is contained in:
@@ -149,9 +149,9 @@ bool CCoinsViewDB::BatchWrite(CoinsViewCacheCursor& cursor, const uint256 &hashB
|
||||
batch.Write(DB_BEST_BLOCK, hashBlock);
|
||||
|
||||
LogDebug(BCLog::COINDB, "Writing final batch of %.2f MiB\n", batch.ApproximateSize() * (1.0 / 1048576.0));
|
||||
bool ret = m_db->WriteBatch(batch);
|
||||
m_db->WriteBatch(batch);
|
||||
LogDebug(BCLog::COINDB, "Committed %u changed transaction outputs (out of %u) to coin database...\n", (unsigned int)changed, (unsigned int)count);
|
||||
return ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t CCoinsViewDB::EstimateSize() const
|
||||
|
||||
Reference in New Issue
Block a user