From e97af7e13d8aa08e347539aab4356b34645cb35f Mon Sep 17 00:00:00 2001 From: eroderust Date: Tue, 3 Mar 2026 11:36:05 +0800 Subject: [PATCH] refactor: use the built-in max/min to simplify the code Signed-off-by: eroderust --- block/internal/syncing/syncer.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block/internal/syncing/syncer.go b/block/internal/syncing/syncer.go index fd0f966c8..ce96c23ef 100644 --- a/block/internal/syncing/syncer.go +++ b/block/internal/syncing/syncer.go @@ -893,11 +893,7 @@ func (s *Syncer) gracePeriodForEpoch(epochStart, epochEnd uint64) uint64 { extra = (avgBytes - threshold) / threshold } - grace := baseGracePeriodEpochs + extra - if grace > maxGracePeriodEpochs { - grace = maxGracePeriodEpochs - } - return grace + return min(baseGracePeriodEpochs+extra, maxGracePeriodEpochs) } // VerifyForcedInclusionTxs checks that every forced-inclusion tx submitted