MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / FlushChainstateBlockFile

Method FlushChainstateBlockFile

src/node/blockstorage.cpp:797–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795}
796
797bool BlockManager::FlushChainstateBlockFile(int tip_height)
798{
799 AssertLockHeld(::cs_main);
800 auto& cursor = m_blockfile_cursors[BlockfileTypeForHeight(tip_height)];
801 // If the cursor does not exist, it means an assumeutxo snapshot is loaded,
802 // but no blocks past the snapshot height have been written yet, so there
803 // is no data associated with the chainstate, and it is safe not to flush.
804 if (cursor) {
805 return FlushBlockFile(cursor->file_num, /*fFinalize=*/false, /*finalize_undo=*/false);
806 }
807 // No need to log warnings in this case.
808 return true;
809}
810
811uint64_t BlockManager::CalculateCurrentUsage()
812{

Callers 1

FlushStateToDiskMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected