Expose the full set of outbound HTLCs from a `ChannelMonitor`
authorMatt Corallo <git@bluematt.me>
Tue, 15 Nov 2022 23:35:31 +0000 (23:35 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 5 Dec 2022 20:27:35 +0000 (20:27 +0000)
commite142f67917c56bee74af1e0f33bbede2803e4b15
tree0a1b8801a0fa60fa6eb5b19e5ce821b45521f785
parenta4c4301730c78e0adbf5810c753ca37b1ba8063b
Expose the full set of outbound HTLCs from a `ChannelMonitor`

This expands the outbound-HTLC-listing support in `ChannelMonitor`
to include not only the set of outbound HTLCs which have not yet
been resolved but to also include the full set of HTLCs which the
`ChannelMonitor` is currently able to to or has already finalized.

This will be used in the next commit to fail-back HTLCs which were
removed from a channel in the ChannelMonitor but not in a Channel.
Using the existing `get_pending_outbound_htlcs` for this purpose is
subtly broken - if the channel is already closed, an HTLC fail may
have completed on chain and is no longer "pending" to the monitor,
but the fail event is still in the monitor waiting to be handed
back to the `ChannelMonitor` when polled.
lightning/src/chain/channelmonitor.rs