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:
parent
70be812747
commit
8b6a9bb5d3
@ -966,7 +966,8 @@ func (g *GossipSyncer) FilterGossipMsgs(msgs ...msgWithSenders) {
|
|||||||
|
|
||||||
passesFilter := func(timeStamp uint32) bool {
|
passesFilter := func(timeStamp uint32) bool {
|
||||||
t := time.Unix(int64(timeStamp), 0)
|
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))
|
msgsToSend := make([]lnwire.Message, 0, len(msgs))
|
||||||
|
Loading…
Reference in New Issue
Block a user