Changeset View
Changeset View
Standalone View
Standalone View
src/txdb.cpp
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | bool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { | ||||
// In the last batch, mark the database as consistent with hashBlock again. | // In the last batch, mark the database as consistent with hashBlock again. | ||||
batch.Erase(DB_HEAD_BLOCKS); | batch.Erase(DB_HEAD_BLOCKS); | ||||
batch.Write(DB_BEST_BLOCK, hashBlock); | batch.Write(DB_BEST_BLOCK, hashBlock); | ||||
LogPrint(BCLog::COINDB, "Writing final batch of %.2f MiB\n", | LogPrint(BCLog::COINDB, "Writing final batch of %.2f MiB\n", | ||||
batch.SizeEstimate() * (1.0 / 1048576.0)); | batch.SizeEstimate() * (1.0 / 1048576.0)); | ||||
bool ret = db.WriteBatch(batch); | bool ret = db.WriteBatch(batch); | ||||
LogPrint(BCLog::COINDB, "Committed %u changed transaction outputs (out of " | LogPrint(BCLog::COINDB, | ||||
"Committed %u changed transaction outputs (out of " | |||||
"%u) to coin database...\n", | "%u) to coin database...\n", | ||||
(unsigned int)changed, (unsigned int)count); | (unsigned int)changed, (unsigned int)count); | ||||
return ret; | return ret; | ||||
} | } | ||||
size_t CCoinsViewDB::EstimateSize() const { | size_t CCoinsViewDB::EstimateSize() const { | ||||
return db.EstimateSize(DB_COIN, char(DB_COIN + 1)); | return db.EstimateSize(DB_COIN, char(DB_COIN + 1)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |