Consistently clean up when failing in `internal_funding_created` 2023-11-robuster-chan-to-peer
authorMatt Corallo <git@bluematt.me>
Thu, 30 Nov 2023 00:04:09 +0000 (00:04 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 15 Dec 2023 21:08:14 +0000 (21:08 +0000)
commite9452c701bd38a343cc44eed3c1f5892e047508e
tree0b91778e71000891c56ed42b69f2d4a3ceeab865
parent1bee708742604fa7993625af7bf6d57d86a398d0
Consistently clean up when failing in `internal_funding_created`

When we fail to accept a counterparty's funding for various
reasons, we should ensure we call the correct cleanup methods in
`internal_funding_created` to remove the temporary data for the
channel in our various internal structs (primarily the SCID alias
map).

This adds the missing cleanup, using `convert_chan_phase_err`
consistently in all the error paths.

This also ensures we get a `ChannelClosed` event when relevant.
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs