From 1fac05b4334881e43510503a669f7c8d93d7e8b1 Mon Sep 17 00:00:00 2001 From: realuncle Date: Sun, 26 Sep 2021 12:06:26 +0800 Subject: [PATCH] resolve comment --- consensus/parlia/parlia.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 8c0b647b2a..729c6f3730 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -800,8 +800,9 @@ func (p *Parlia) Delay(chain consensus.ChainReader, header *types.Header) *time. } delay := p.delayForRamanujanFork(snap, header) // The blocking time should be no more than half of period - if delay > time.Duration(p.config.Period)*time.Second/2 { - delay = time.Duration(p.config.Period) * time.Second / 2 + half := time.Duration(p.config.Period) * time.Second / 2 + if delay > half { + delay = half } return &delay }