From 7180750d1fe20f797b29ff5e7ac9ef040064a6fc Mon Sep 17 00:00:00 2001 From: William Banfield Date: Thu, 28 Oct 2021 14:34:45 +0200 Subject: [PATCH] remove old istimely --- state/state.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/state/state.go b/state/state.go index 85d0f5612..5862162d1 100644 --- a/state/state.go +++ b/state/state.go @@ -304,24 +304,6 @@ func MedianTime(commit *types.Commit, validators *types.ValidatorSet) time.Time return weightedMedian(weightedTimes, totalVotingPower) } -// IsTimely validates that the passed in block timestamp is 'timely' according to the proposer-based timestamp algorithm. -// To evaluate if a timestamp is timely, it is compared to the local time of the validator along with the configured -// Precision and MsgDelay parameters. -// Specifically, a proposed block timestamp is considered timely if it is satisfies the following inequalities: -// -// proposedBlockTime < validatorLocalTime + Precision + MsgDelay && proposedBlockTime > validatorLocaltime - Precision. -// -// For more information on the meaning of 'timely', see the proposer-based timestamp specification: -// https://github.com/tendermint/spec/tree/master/spec/consensus/proposer-based-timestamp -func IsTimely(bt time.Time, lt time.Time, precision time.Duration, msgDelay time.Duration) bool { - lhs := lt.Add(-precision).UnixMilli() - rhs := lt.Add(precision).Add(msgDelay).UnixMilli() - if lhs < bt.UnixMilli() && bt.UnixMilli() < rhs { - return true - } - return false -} - //------------------------------------------------------------------------ // Genesis