Merge branch '0-18-4-branch-rc1-9084' into 0-18-4-branch-rc1

This commit is contained in:
Oliver Gugger 2024-11-13 12:52:32 +01:00
commit 31ace742a5
No known key found for this signature in database
GPG key ID: 8E4256593F177720
2 changed files with 6 additions and 6 deletions

View file

@ -835,12 +835,6 @@ func (g *GossipSyncer) processChanRangeReply(msg *lnwire.ReplyChannelRange) erro
} }
g.prevReplyChannelRange = msg 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 { for i, scid := range msg.ShortChanIDs {
info := channeldb.NewChannelUpdateInfo( info := channeldb.NewChannelUpdateInfo(

View file

@ -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. // Set the corresponding TLV types if they were included in the stream.
if val, ok := typeMap[TimestampsRecordType]; ok && val == nil { if val, ok := typeMap[TimestampsRecordType]; ok && val == nil {
c.Timestamps = timeStamps 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 { if len(tlvRecords) != 0 {