More regularly send an Error message when we force-close a channel
authorMatt Corallo <git@bluematt.me>
Fri, 19 Mar 2021 00:32:20 +0000 (20:32 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 5 Apr 2021 17:03:04 +0000 (13:03 -0400)
commit871f4143672b9d8e616dbc2b6df87366590179d0
tree5809fe6fb4abfd7799fbc9ccdb73c4d669d28d1e
parent2a432c6fa531c707a8fd69d949834f979ef5d81c
More regularly send an Error message when we force-close a channel

When we force-close a channel, for whatever reason, it is nice to
send an error message to our peer. This allows them to closes the
channel on their end instead of trying to send through it and
failing. Further, it may induce them to broadcast their commitment
transaction, possibly getting that confirmed and saving us on fees.

This commit adds a few more cases where we should have been sending
error messages but weren't. It also includes an almost-global
replace in tests of the second argument in
`check_closed_broadcast!()` from false to true (indicating an error
message is expected). There are only a few exceptions, notably
those where the closure is the result of our counterparty having
sent *us* an error message.
lightning-persister/src/lib.rs
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/reorg_tests.rs