Skip to content

Commit b89f307

Browse files
committed
Fix incorrect variable name in FindFilesToPrune
1 parent 2cc1372 commit b89f307

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,7 +2932,7 @@ void FindFilesToPrune(std::set<int>& setFilesToPrune)
29322932
return;
29332933
}
29342934

2935-
unsigned int nLastBlockWeMustKeep = chainActive.Tip()->nHeight - MIN_BLOCKS_TO_KEEP;
2935+
unsigned int nLastBlockWeCanPrune = chainActive.Tip()->nHeight - MIN_BLOCKS_TO_KEEP;
29362936
uint64_t nCurrentUsage = CalculateCurrentUsage();
29372937
// We don't check to prune until after we've allocated new space for files
29382938
// So we should leave a buffer under our target to account for another allocation
@@ -2952,7 +2952,7 @@ void FindFilesToPrune(std::set<int>& setFilesToPrune)
29522952
break;
29532953

29542954
// don't prune files that could have a block within MIN_BLOCKS_TO_KEEP of the main chain's tip
2955-
if (vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeMustKeep)
2955+
if (vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeCanPrune)
29562956
break;
29572957

29582958
PruneOneBlockFile(fileNumber);
@@ -2963,10 +2963,10 @@ void FindFilesToPrune(std::set<int>& setFilesToPrune)
29632963
}
29642964
}
29652965

2966-
LogPrint("prune", "Prune: target=%dMiB actual=%dMiB diff=%dMiB min_must_keep=%d removed %d blk/rev pairs\n",
2966+
LogPrint("prune", "Prune: target=%dMiB actual=%dMiB diff=%dMiB max_prune_height=%d removed %d blk/rev pairs\n",
29672967
nPruneTarget/1024/1024, nCurrentUsage/1024/1024,
29682968
((int64_t)nPruneTarget - (int64_t)nCurrentUsage)/1024/1024,
2969-
nLastBlockWeMustKeep, count);
2969+
nLastBlockWeCanPrune, count);
29702970
}
29712971

29722972
bool CheckDiskSpace(uint64_t nAdditionalBytes)

0 commit comments

Comments
 (0)