| 566 | } |
| 567 | |
| 568 | void 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 | |
| 580 | uint64_t BlockManager::CalculateCurrentUsage() |
| 581 | { |
no test coverage detected