]> git.bitcoin.ninja Git - rust-lightning/commit
Never generate a `BroadcastChannelUpdate` for priv channels
authorMatt Corallo <git@bluematt.me>
Fri, 11 Jun 2021 16:03:34 +0000 (16:03 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 11 Jun 2021 16:03:34 +0000 (16:03 +0000)
commite1ab066185ed0a2d23a641497e20baf95ceafe29
tree95fc28c5882cb2c3ea745378bfa4641b118882de
parent41bb42a99cd9df2d297ae938303b15deefe66e62
Never generate a `BroadcastChannelUpdate` for priv channels

Currently we always generate a
`MessageSendEvent::BroadcastChannelUpdate` when a channel is closed
even if the channel is private. Our immediate peers should ignore
such messages as they haven't seen a corresponding
`channel_announcement`, but we are still giving up some privacy by
informing our immediate peers of which channels were ours.

Here we split `ChannelManager::get_channel_update` into a
`get_channel_update_for_broadcast` and
`get_channel_update_for_unicast`. The first is used when we are
broadcasting a `channel_update`, allowing us to refuse to do so
for private channels. The second is used when failing a payment (in
which case the recipient has already shown that they are aware of
the channel so no such privacy concerns exist).
lightning/src/ln/channelmanager.rs