From 01a3d069ecd51d7c12c15394923cd6332a0f93ea Mon Sep 17 00:00:00 2001 From: rene <41963722+renaynay@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:48:25 +0200 Subject: [PATCH] fix(sync): allow a greater buffer for recency threshold default --- sync/sync_head.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync/sync_head.go b/sync/sync_head.go index d9f86b27..66a497f6 100644 --- a/sync/sync_head.go +++ b/sync/sync_head.go @@ -192,7 +192,7 @@ func isExpired[H header.Header[H]](header H, period time.Duration) bool { // isRecent checks if header is recent against the given recency threshold. func isRecent[H header.Header[H]](header H, blockTime, recencyThreshold time.Duration) bool { if recencyThreshold == 0 { - recencyThreshold = blockTime + blockTime/2 // allow some drift by adding additional buffer of 1/2 of block time + recencyThreshold = blockTime * 2 // allow some drift by adding additional buffer of 2 blocks } return time.Since(header.Time()) <= recencyThreshold }