Skip to content

Commit

Permalink
ledger: Check MaxAcctLookback in tracker. (#5300)
Browse files Browse the repository at this point in the history
  • Loading branch information
winder authored Apr 13, 2023
1 parent c252aba commit afc7387
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ledger/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ func (tr *trackerRegistry) replay(l ledgerForTracker) (err error) {
roundsBehind = blk.Round() - tr.dbRound
tr.mu.RUnlock()

// are we too far behind ? ( taking into consideration the catchpoint writing, which can stall the writing for quite a bit )
if roundsBehind > initializeCachesRoundFlushInterval+basics.Round(catchpointInterval) {
// are we farther behind than we need to be? Consider: catchpoint interval, flush interval and max acct lookback.
if roundsBehind > basics.Round(maxAcctLookback) && roundsBehind > initializeCachesRoundFlushInterval+basics.Round(catchpointInterval) {
// we're unable to persist changes. This is unexpected, but there is no point in keep trying batching additional changes since any further changes
// would just accumulate in memory.
close(blockEvalFailed)
Expand Down

0 comments on commit afc7387

Please sign in to comment.