mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 23:14:37 +00:00
Prevote nil if not timely
This commit is contained in:
+2
-2
@@ -129,8 +129,8 @@ func DefaultTimingParams() TimingParams {
|
||||
// TODO(@wbanfield): Determine experimental values for these defaults
|
||||
// https://github.com/tendermint/tendermint/issues/7202
|
||||
return TimingParams{
|
||||
Precision: 1 * time.Nanosecond,
|
||||
MessageDelay: 1 * time.Nanosecond,
|
||||
Precision: 10 * time.Millisecond,
|
||||
MessageDelay: 500 * time.Millisecond,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -90,8 +90,8 @@ func (p *Proposal) ValidateBasic() error {
|
||||
// https://github.com/tendermint/spec/tree/master/spec/consensus/proposer-based-timestamp
|
||||
func (p *Proposal) IsTimely(clock tmtime.Source, tp TimingParams) bool {
|
||||
lt := clock.Now()
|
||||
lhs := lt.Add(-tp.Precision)
|
||||
rhs := lt.Add(tp.Precision).Add(tp.MessageDelay)
|
||||
lhs := lt.Add(-tp.Precision).Add(-tp.MessageDelay)
|
||||
rhs := lt.Add(tp.Precision)
|
||||
if lhs.Before(p.Timestamp) && rhs.After(p.Timestamp) {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user