Skip to content

Commit 31ace74

Browse files
committed
Merge branch '0-18-4-branch-rc1-9084' into 0-18-4-branch-rc1
2 parents 9bf48a7 + 2c25f38 commit 31ace74

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

discovery/syncer.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,12 +835,6 @@ func (g *GossipSyncer) processChanRangeReply(msg *lnwire.ReplyChannelRange) erro
835835
}
836836

837837
g.prevReplyChannelRange = msg
838-
if len(msg.Timestamps) != 0 &&
839-
len(msg.Timestamps) != len(msg.ShortChanIDs) {
840-
841-
return fmt.Errorf("number of timestamps not equal to " +
842-
"number of SCIDs")
843-
}
844838

845839
for i, scid := range msg.ShortChanIDs {
846840
info := channeldb.NewChannelUpdateInfo(

lnwire/reply_channel_range.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ func (c *ReplyChannelRange) Decode(r io.Reader, pver uint32) error {
104104
// Set the corresponding TLV types if they were included in the stream.
105105
if val, ok := typeMap[TimestampsRecordType]; ok && val == nil {
106106
c.Timestamps = timeStamps
107+
108+
// Check that a timestamp was provided for each SCID.
109+
if len(c.Timestamps) != len(c.ShortChanIDs) {
110+
return fmt.Errorf("number of timestamps does not " +
111+
"match number of SCIDs")
112+
}
107113
}
108114

109115
if len(tlvRecords) != 0 {

0 commit comments

Comments
 (0)