Move DiscardFunding generation into finish_close_channel
authorMatt Corallo <git@bluematt.me>
Fri, 29 Dec 2023 03:15:18 +0000 (03:15 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 29 Dec 2023 06:27:31 +0000 (06:27 +0000)
commitee5b8c7003af296bc8189b0b6075889a106513c5
treefb30e663aed9e646414145b5d93ccca4f62edef3
parent396c36b6ea2335acabd297eb7ed1acaac69a80ea
Move DiscardFunding generation into finish_close_channel

Currently the channel shutdown sequence has a number of steps which
all the shutdown callsites have to call. Because many shutdown
cases are rare error cases, its relatively easy to miss a call and
leave users without `Event`s or miss some important cleanup.

One of those steps, calling `issue_channel_close_events`, is rather
easy to remove, as it only generates two events, which can simply
be moved to another shutdown step.

Here we move the first of the two events, `DiscardFunding`, into
`finish_force_close_channel`.
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs