Log when trimming block solutions

This commit is contained in:
Duke
2023-12-27 11:43:53 -05:00
parent 497ace0922
commit 2a2391f0f9

View File

@@ -3713,9 +3713,12 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) {
// Now that we have written the block indices to the database, we do not // Now that we have written the block indices to the database, we do not
// need to store solutions for these CBlockIndex objects in memory. // need to store solutions for these CBlockIndex objects in memory.
// cs_main must be held here. // cs_main must be held here.
uint32_t nTrimmed = 0;
for (CBlockIndex *pblockindex : vBlocks) { for (CBlockIndex *pblockindex : vBlocks) {
pblockindex->TrimSolution(); pblockindex->TrimSolution();
++nTrimmed;
} }
LogPrintf("%s: trimmed %d solutions from block index\n", __func__, nTrimmed);
} }
// Finally remove any pruned files // Finally remove any pruned files
if (fFlushForPrune) if (fFlushForPrune)