rust-lightning/lightning
Matt Corallo 2d6818376c Drop forwarded HTLCs which were still pending at persist-time
If, after forwarding an intercepted payment to our counterparty, we
restart with a ChannelMonitor update having been persisted, but the
corresponding ChannelManager update not having been persisted,
we'll still have the intercepted HTLC in the
`pending_intercepted_htlcs` map on start (and potentially a pending
`HTLCIntercepted` event). This will cause us to allow the user to
handle the forwarded HTLC twice, potentially double-forwarding it.

This builds on 0bb87ddad7, which
provided a preemptive fix for the general relay case (though it was
not an actual issue at the time). We simply check for the HTLCs
having been forwarded on startup and remove them from the map.

Fixes #1858
2022-12-13 19:33:58 +00:00
..
src Drop forwarded HTLCs which were still pending at persist-time 2022-12-13 19:33:58 +00:00
Cargo.toml Bump crate versions to 0.0.112/invoice 0.20 2022-10-24 18:53:58 +00:00