Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions discovery/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,12 +835,6 @@ func (g *GossipSyncer) processChanRangeReply(msg *lnwire.ReplyChannelRange) erro
}

g.prevReplyChannelRange = msg
if len(msg.Timestamps) != 0 &&
len(msg.Timestamps) != len(msg.ShortChanIDs) {

return fmt.Errorf("number of timestamps not equal to " +
"number of SCIDs")
}

for i, scid := range msg.ShortChanIDs {
info := channeldb.NewChannelUpdateInfo(
Expand Down
6 changes: 6 additions & 0 deletions lnwire/reply_channel_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ func (c *ReplyChannelRange) Decode(r io.Reader, pver uint32) error {
// Set the corresponding TLV types if they were included in the stream.
if val, ok := typeMap[TimestampsRecordType]; ok && val == nil {
c.Timestamps = timeStamps

// Check that a timestamp was provided for each SCID.
if len(c.Timestamps) != len(c.ShortChanIDs) {
return fmt.Errorf("number of timestamps does not " +
"match number of SCIDs")
}
}

if len(tlvRecords) != 0 {
Expand Down
Loading