mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +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:
@@ -274,7 +274,7 @@ CDBWrapper::~CDBWrapper()
|
||||
DBContext().options.env = nullptr;
|
||||
}
|
||||
|
||||
bool CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync)
|
||||
void CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync)
|
||||
{
|
||||
const bool log_memory = LogAcceptCategory(BCLog::LEVELDB, BCLog::Level::Debug);
|
||||
double mem_before = 0;
|
||||
@@ -288,7 +288,6 @@ bool CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync)
|
||||
LogDebug(BCLog::LEVELDB, "WriteBatch memory usage: db=%s, before=%.1fMiB, after=%.1fMiB\n",
|
||||
m_name, mem_before, mem_after);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t CDBWrapper::DynamicMemoryUsage() const
|
||||
|
||||
Reference in New Issue
Block a user