mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-18 22:14:35 +00:00
consensus: add calculation for proposal step waits from pbts (#7290)
* initial proposerWaitsUntil implementation * switch to duration for easier use with timeout scheduling * add proposal step waiting time with tests * minor aesthetic change to IsTimely * minor language fix * Update internal/consensus/state.go Co-authored-by: M. J. Fromberger <fromberger@interchain.io> * reword comment * change accuracy to precision * move tests to separate pbts test file Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This commit is contained in:
co-authored by
M. J. Fromberger
parent
89e3f43cbc
commit
32008ae1d8
+1
-1
@@ -92,7 +92,7 @@ func (p *Proposal) IsTimely(clock tmtime.Source, tp TimestampParams) bool {
|
||||
lt := clock.Now()
|
||||
lhs := lt.Add(-tp.Precision)
|
||||
rhs := lt.Add(tp.Precision).Add(tp.MsgDelay)
|
||||
if lhs.Before(p.Timestamp) && p.Timestamp.Before(rhs) {
|
||||
if lhs.Before(p.Timestamp) && rhs.After(p.Timestamp) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user