consensus/parlia: exclude inturn validator when calculate backoffTime (#2618)

This commit is contained in:
Nathan 2024-07-31 16:37:50 +08:00 committed by GitHub
parent 7d907016ff
commit 987b8c1504
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2029,12 +2029,17 @@ func (p *Parlia) backOffTime(snap *Snapshot, header *types.Header, val common.Ad
delay = 0
}
// Exclude the recently signed validators
// Exclude the recently signed validators and the in turn validator
temp := make([]common.Address, 0, len(validators))
for _, addr := range validators {
if snap.signRecentlyByCounts(addr, counts) {
continue
}
if p.chainConfig.IsBohr(header.Number, header.Time) {
if addr == inTurnAddr {
continue
}
}
temp = append(temp, addr)
}
validators = temp