From 8556473e69bda4367c9a8ced4bd6e424a3f073d9 Mon Sep 17 00:00:00 2001 From: Wang Gerui Date: Tue, 3 Dec 2024 23:05:03 +0800 Subject: [PATCH] feat: reduce wait time when block time already large --- miner/worker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index c96379210c..599a4e935e 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -366,9 +366,9 @@ func getResetTime(chain *core.BlockChain, minePeriod int, prevReset0TimeMillisec if resetTime > minePeriodDuration { resetTime = minePeriodDuration } - // in case the current block is too far in the past, the block time already is huge, we wait for mine period + // in case the current block is too far in the past, the block time already is huge, we wait for 0 time (which will be handled in the next if statement) if resetTime < 0 { - resetTime = minePeriodDuration + resetTime = 0 } if resetTime == 0 { if nowTime == *prevReset0TimeMillisec {