]> git.bitcoin.ninja Git - rust-lightning/commit
Separate ChannelAnnouncement and ChannelUpdate broadcast conditions
authorMatt Corallo <git@bluematt.me>
Sat, 13 Nov 2021 00:27:05 +0000 (00:27 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 23 Nov 2021 22:17:18 +0000 (22:17 +0000)
commit74828d243567af448cec5f09eb2d6a8eeed3ca48
tree481f4cd0537850670f0c6b86971649f1da3704d7
parentef86a3e20952a96f7b646a9a4154aa5dc220147a
Separate ChannelAnnouncement and ChannelUpdate broadcast conditions

When a `ChannelUpdate` message is generated for broadcast as a part
of a `BroadcastChannelAnnouncement` event, it may be newer than our
previous `ChannelUpdate` and need to be broadcast. However, if the
`ChannelAnnouncement` had already been seen we wouldn't
re-broadcast either message as the `handle_channel_announcement`
call would fail, short-circuiting the condition to broadcast both.

Instead, we split the broadcast of each message as well as the
conditional so that we always attempt to handle each message and
update our local graph state, then broadcast the message if its
update was processed successfully.
lightning/src/ln/peer_handler.rs