]> git.bitcoin.ninja Git - rust-lightning/commit
Unset `Channel::is_usable` if mon update is blocking funding_locked
authorMatt Corallo <git@bluematt.me>
Thu, 18 Nov 2021 21:54:10 +0000 (21:54 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Dec 2021 00:16:55 +0000 (00:16 +0000)
commit1f702ca9d5158916601fcd26bdde452dc9eb7712
treed5a89b4efe5159e17fbeffc7700daa79cec6c9b6
parent20cb2a423d55a0740f0f479e38bf3f762d4e3fbe
Unset `Channel::is_usable` if mon update is blocking funding_locked

If we have not yet sent `funding_locked` only because of a pending
channel monitor update, we shouldn't consider a channel
`is_usable`. This has a number of downstream effects, including
not attempting to route payments through the channel, not sending
private `channel_update` messages to our counterparty, or sending
channel_announcement messages if our couterparty has already signed
for it.

We further gate generation of `node_announcement`s on `is_usable`,
preventing generation of those or `announcement_signatures` until
we've sent our `funding_locked`.

Finally, `during_funding_monitor_fail` is updated to test a case
where we see the funding transaction lock in but have a pending
monitor update failure, then receive `funding_locked` from our
counterparty and ensure we don't generate the above messages until
after the monitor update completes.
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs