From 1722d4aac1b168b99c0da9c110bd5bc93086ba27 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Thu, 29 Jun 2023 12:46:53 -0700 Subject: [PATCH] Reduce the number of untrimmed headers in memory, since they can be untrimmed on demand now --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index ee19aed4f1..fe772e5899 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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.