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.
This commit is contained in:
Wilmer Paulino committed 2019-04-03 15:44:46 -07:00
1 parent 70be812747
commit 8b6a9bb5d3
1 file changed
+2 -1
+2 -1
View File
@@ -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))