]> git.bitcoin.ninja Git - rust-lightning/commit
Track the cp `node_id` which originated an HTLC in the `HTLCSource`
authorMatt Corallo <git@bluematt.me>
Wed, 12 Jun 2024 20:49:07 +0000 (20:49 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 8 Jul 2024 19:06:59 +0000 (19:06 +0000)
commit453ed11f80b40f28b6e95a74b1f7ed2cd7f012ad
tree7422f32ced48229528e8c63b03fa355a84b6022d
parent1c6ce8e78913ed1dbd0e4328a6df953b6de60f50
Track the cp `node_id` which originated an HTLC in the `HTLCSource`

Because we track pending `ChannelMonitorUpdate`s per-peer, we
really need to know what peer an HTLC came from when we go to claim
it on-chain, allowing us to look up any blocked actions in the
`PeerState`. While we could do this by moving the blocked actions
to some global "closed-channel update queue", its simpler to do it
this way.

While this trades off `ChannelMonitorUpdate` size somewhat (the
`HTLCSource` is included in many of them), which we should be
sensitive to, it will also allow us to (eventually) remove the
SCID -> peer + channel_id lookups we do when claiming or failing
today, which are somewhat annoying to deal with.
lightning/src/ln/channelmanager.rs