Skip to content

Commit

Permalink
don't recenter on past
Browse files Browse the repository at this point in the history
  • Loading branch information
stackdump committed Aug 28, 2019
1 parent 7a0ed4f commit 3b7acd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion state/replay.go
Expand Up @@ -236,7 +236,6 @@ func (r *Replay) validate(mask int, hash [32]byte, timestamp interfaces.Timestam
now := Minutes(systemtime.GetTimeSeconds())
t := Minutes(timestamp.GetTimeSeconds())

// REVIEW: should this be removed so that only Heartbeat are needed to move this forward?
r.Recenter(systemtime) // Move the center of our replay list to the current time.

diff := now - t
Expand Down
4 changes: 2 additions & 2 deletions state/state.go
Expand Up @@ -2258,7 +2258,7 @@ func (s *State) SetMessageFilterTimestamp(leaderTS interfaces.Timestamp) {

func (s *State) GotHeartbeat(heartbeatTS interfaces.Timestamp, dbheight uint32) {

if ! s.DBFinished {
if !s.DBFinished {
return
}

Expand All @@ -2279,7 +2279,7 @@ func (s *State) GotHeartbeat(heartbeatTS interfaces.Timestamp, dbheight uint32)
s.SetHighestKnownBlock(dbheight)

// re-center replay filter
s.Replay.Recenter(primitives.NewTimestampFromMilliseconds(uint64(newTS - 60*60*1000)))
s.Replay.Recenter(primitives.NewTimestampFromMilliseconds(uint64(newTS)))
}

func (s *State) SetLeaderTimestamp(ts interfaces.Timestamp) {
Expand Down

0 comments on commit 3b7acd4

Please sign in to comment.