Do not force-close channels when we cannot communicate with peers 2022-04-drop-no-conn-possible
authorMatt Corallo <git@bluematt.me>
Mon, 18 Apr 2022 02:10:44 +0000 (02:10 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Apr 2022 02:50:06 +0000 (02:50 +0000)
commite39d63c7d4461d43dc7a0ed7851fb55913325399
tree9722aed88291cab8a5dcb13a3790fd34794e065e
parent62edee568985e3362bd1609c6089d05428023925
Do not force-close channels when we cannot communicate with peers

In general, we should never be automatically force-closing our
users' channels unless there is some immediate risk of funds loss
(ie because of some HTLC(s) which are timing out soon). In any
other case, we should trust the user to be able to figure out what
is going on and close their channels manually instead of trying to
be overly clever and automate closures if we think the channel is
useless.

In this case, even if a peer has some required feature that does
not allow us to communicate with them, there is a strong
possibility that some LDK upgrade may allow us to in the future. In
the mean time, there is no reason to go on-chain unless the user
needs funds immediately. In such a case, the user should already
have logic to force-close channels with peers which are not
available for any reason.
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/peer_handler.rs
lightning/src/util/events.rs