rust-lightning/lightning/src/ln
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
..
chan_utils.rs Use Witness::push_bitcoin_signature where relevant 2022-12-07 23:17:58 +00:00
chanmon_update_fail_tests.rs Merge pull request #1867 from wpaulino/remove-signer-persistence 2022-12-06 18:13:49 +00:00
channel.rs Merge pull request #1863 from TheBlueMatt/2022-11-holding-cell-batch-update 2022-12-07 17:52:04 +00:00
channelmanager.rs Drop forwarded HTLCs which were still pending at persist-time 2022-12-13 19:33:58 +00:00
features.rs Invoice request message interface and data format 2022-12-09 08:53:33 -06:00
functional_test_utils.rs Rename variables referring to PaymentClaimable 2022-12-06 10:47:07 +01:00
functional_tests.rs Clean up docs in keysinterface.rs 2022-12-12 21:31:26 +01:00
inbound_payment.rs Remove generic Signer parameter where it can be inferred from KeysInterface 2022-11-09 16:15:11 -08:00
mod.rs Move restart-related tests to their own file 2022-11-15 22:38:12 +00:00
monitor_tests.rs Rename PaymentReceived to PaymentClaimable 2022-12-01 09:39:33 +01:00
msgs.rs Merge pull request #1413 from ViktorTigerstrom/2022-04-default-to-bolt4-tlv-onions 2022-11-11 00:49:45 +00:00
onion_route_tests.rs Merge pull request #1895 from TheBlueMatt/2022-12-fix-missing-data 2022-12-06 22:46:04 +00:00
onion_utils.rs Merge pull request #1895 from TheBlueMatt/2022-12-fix-missing-data 2022-12-06 22:46:04 +00:00
payment_tests.rs Merge pull request #1891 from tnull/2022-12-rename-payment-events 2022-12-04 19:31:52 +00:00
peer_channel_encryptor.rs Bump workspace to rust edition 2018 2022-10-21 14:47:34 -07:00
peer_handler.rs Give us a self when reading a custom onion message 2022-10-27 15:58:33 -04:00
priv_short_conf_tests.rs Rename PaymentReceived to PaymentClaimable 2022-12-01 09:39:33 +01:00
reload_tests.rs Drop forwarded HTLCs which were still pending at persist-time 2022-12-13 19:33:58 +00:00
reorg_tests.rs Expose confirmations via ChannelDetails 2022-11-29 18:49:54 +01:00
script.rs Bump workspace to rust edition 2018 2022-10-21 14:47:34 -07:00
shutdown_tests.rs Allow users to specify the PaymentId for new outbound payments 2022-11-02 01:09:07 +00:00
wire.rs Bump workspace to rust edition 2018 2022-10-21 14:47:34 -07:00