Skip to content

Commit 485899a

Browse files
committed
style: Make FindFilesToPrune{,Manual} match style guide
[META] This is a pure style commit.
1 parent 3f5b5f3 commit 485899a

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/validation.cpp

+12-7
Original file line numberDiff line numberDiff line change
@@ -3999,15 +3999,17 @@ void BlockManager::FindFilesToPruneManual(std::set<int>& setFilesToPrune, int nM
39993999
assert(fPruneMode && nManualPruneHeight > 0);
40004000

40014001
LOCK2(cs_main, cs_LastBlockFile);
4002-
if (chain_tip_height < 0)
4002+
if (chain_tip_height < 0) {
40034003
return;
4004+
}
40044005

40054006
// last block to prune is the lesser of (user-specified height, MIN_BLOCKS_TO_KEEP from the tip)
40064007
unsigned int nLastBlockWeCanPrune = std::min((unsigned)nManualPruneHeight, chain_tip_height - MIN_BLOCKS_TO_KEEP);
4007-
int count=0;
4008+
int count = 0;
40084009
for (int fileNumber = 0; fileNumber < nLastBlockFile; fileNumber++) {
4009-
if (vinfoBlockFile[fileNumber].nSize == 0 || vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeCanPrune)
4010+
if (vinfoBlockFile[fileNumber].nSize == 0 || vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeCanPrune) {
40104011
continue;
4012+
}
40114013
PruneOneBlockFile(fileNumber);
40124014
setFilesToPrune.insert(fileNumber);
40134015
count++;
@@ -4058,7 +4060,7 @@ void BlockManager::FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPr
40584060
// before the next pruning.
40594061
uint64_t nBuffer = BLOCKFILE_CHUNK_SIZE + UNDOFILE_CHUNK_SIZE;
40604062
uint64_t nBytesToPrune;
4061-
int count=0;
4063+
int count = 0;
40624064

40634065
if (nCurrentUsage + nBuffer >= nPruneTarget) {
40644066
// On a prune event, the chainstate DB is flushed.
@@ -4073,15 +4075,18 @@ void BlockManager::FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPr
40734075
for (int fileNumber = 0; fileNumber < nLastBlockFile; fileNumber++) {
40744076
nBytesToPrune = vinfoBlockFile[fileNumber].nSize + vinfoBlockFile[fileNumber].nUndoSize;
40754077

4076-
if (vinfoBlockFile[fileNumber].nSize == 0)
4078+
if (vinfoBlockFile[fileNumber].nSize == 0) {
40774079
continue;
4080+
}
40784081

4079-
if (nCurrentUsage + nBuffer < nPruneTarget) // are we below our target?
4082+
if (nCurrentUsage + nBuffer < nPruneTarget) { // are we below our target?
40804083
break;
4084+
}
40814085

40824086
// don't prune files that could have a block within MIN_BLOCKS_TO_KEEP of the main chain's tip but keep scanning
4083-
if (vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeCanPrune)
4087+
if (vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeCanPrune) {
40844088
continue;
4089+
}
40854090

40864091
PruneOneBlockFile(fileNumber);
40874092
// Queue up the files for removal

0 commit comments

Comments
 (0)