mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01: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:
@@ -88,7 +88,8 @@ bool BlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFi
|
||||
for (const CBlockIndex* bi : blockinfo) {
|
||||
batch.Write(std::make_pair(DB_BLOCK_INDEX, bi->GetBlockHash()), CDiskBlockIndex{bi});
|
||||
}
|
||||
return WriteBatch(batch, true);
|
||||
WriteBatch(batch, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BlockTreeDB::WriteFlag(const std::string& name, bool fValue)
|
||||
|
||||
Reference in New Issue
Block a user