From 8b6a9bb5d352f66d53a8358ca2d871bee8894b86 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Fri, 22 Mar 2019 19:56:48 -0700 Subject: [PATCH] discovery: make timestamp range check inclusive within FilterGossipMsgs As required by the spec: > SHOULD send all gossip messages whose timestamp is greater or equal to first_timestamp, and less than first_timestamp plus timestamp_range. --- discovery/syncer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discovery/syncer.go b/discovery/syncer.go index 1157cd4b..791e31c9 100644 --- a/discovery/syncer.go +++ b/discovery/syncer.go @@ -966,7 +966,8 @@ func (g *GossipSyncer) FilterGossipMsgs(msgs ...msgWithSenders) { passesFilter := func(timeStamp uint32) bool { t := time.Unix(int64(timeStamp), 0) - return t.After(startTime) && t.Before(endTime) + return t.Equal(startTime) || + (t.After(startTime) && t.Before(endTime)) } msgsToSend := make([]lnwire.Message, 0, len(msgs))