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 2019-03-22 19:56:48 -07:00
parent 70be812747
commit 8b6a9bb5d3
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

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))