MCPcopy Create free account
hub / github.com/ElementsProject/elements / FlushBlockFile

Method FlushBlockFile

src/node/blockstorage.cpp:568–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568void BlockManager::FlushBlockFile(bool fFinalize, bool finalize_undo)
569{
570 LOCK(cs_LastBlockFile);
571 FlatFilePos block_pos_old(m_last_blockfile, m_blockfile_info[m_last_blockfile].nSize);
572 if (!BlockFileSeq().Flush(block_pos_old, fFinalize)) {
573 AbortNode("Flushing block file to disk failed. This is likely the result of an I/O error.");
574 }
575 // we do not always flush the undo file, as the chain tip may be lagging behind the incoming blocks,
576 // e.g. during IBD or a sync after a node going offline
577 if (!fFinalize || finalize_undo) FlushUndoFile(m_last_blockfile, finalize_undo);
578}
579
580uint64_t BlockManager::CalculateCurrentUsage()
581{

Callers 1

FlushStateToDiskMethod · 0.80

Calls 3

BlockFileSeqFunction · 0.85
AbortNodeFunction · 0.50
FlushMethod · 0.45

Tested by

no test coverage detected