Use the query start block for ReplyChannelRange response messages 2021-06-workaround-broken-cln
authorMatt Corallo <git@bluematt.me>
Sat, 19 Jun 2021 15:48:23 +0000 (15:48 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 8 Jul 2021 14:05:32 +0000 (14:05 +0000)
commit42f6a8f1113fb17d1c07a5d63e5fd70c1e635040
tree34a326c2bb4897cf6639391d9f2675b411b7b635
parent4d1c1a32f20dcce2553ba7ec467e349fc37493c8
Use the query start block for ReplyChannelRange response messages

C-Lightning versions prior to 0.10 (incorrectly) enforce that the
reply_channel_range first_blocknum field is set to at least the
value they sent in their query_channel_range message. Sending a 0
results in them responding with an Error message, closing open
channels spuriously.

Further, C-Lightning versions prior to 0.10 require that the
reply_channel_range first_blocknum is either the same block implied
as the last block of the previous reply_channel_range or one
greater. This is not only a creative interpretation of the spec,
but a perfectly reasonable implementation might still receive an
Error message in the case of replies split by an empty block.

This code is extracted and modified from a previous version of
the original query_channel_range PR in commit
44ba52ccf10bb0362ed2964b66ec2ae51e388161. The original commit is by
`bmancini55 <bmancini@gmail.com>`.
lightning/src/routing/network_graph.rs