We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 20b34c2 + 1aa70c9 commit 03df5a3Copy full SHA for 03df5a3
replica/replica.go
@@ -171,11 +171,11 @@ func (replica *Replica) HandleMessage(m Message) {
171
// message passing.
172
now := block.Timestamp(time.Now().Unix())
173
timestamp := m.Message.(*process.Resync).Timestamp()
174
- if now < timestamp-10 {
175
- replica.options.Logger.Debugf("ignore message: resync timestamp=%v compared to now=%v", timestamp, now)
176
- return
+ delta := now - timestamp
+ if delta < 0 {
+ delta = -delta
177
}
178
- if now > timestamp+10 {
+ if delta > 10 {
179
replica.options.Logger.Debugf("ignore message: resync timestamp=%v compared to now=%v", timestamp, now)
180
return
181
0 commit comments