Reduce the number of untrimmed headers in memory, since they can be untrimmed on demand now

This commit is contained in:
Pablo Greco 2023-06-29 12:46:53 -07:00 committed by James Dorfman
parent c28c5ce619
commit 1722d4aac1

View file

@ -1017,7 +1017,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
// back to current epoch start, and then an additional total_valid_epochs on top of that.
// We add one epoch here for the current partial epoch, and then another one for good luck.
node::nMustKeepFullHeaders = (chainparams.GetConsensus().total_valid_epochs + 2) * epoch_length;
node::nMustKeepFullHeaders = chainparams.GetConsensus().total_valid_epochs * epoch_length;
// This is the number of headers we can have in flight downloading at a time, beyond the
// set of blocks we've already validated. Capping this is necessary to keep memory usage
// bounded during IBD.