rust-lightning/lightning/src/ln
Matt Corallo 70b18663f4 Don't send init closing_signed too early after final HTLC removal
If we remove an HTLC (or fee update), commit, and receive our
counterparty's `revoke_and_ack`, we remove all knowledge of said
HTLC (or fee update). However, the latest local commitment
transaction that we can broadcast still contains the HTLC (or old
fee), thus we are not eligible for initiating the `closing_signed`
negotiation if we're shutting down and are generally expecting a
counterparty `commitment_signed` immediately.

Because we don't have any tracking of these updates in the `Channel`
(only the `ChannelMonitor` is aware of the HTLC being in our latest
local commitment transaction), we'd previously send a
`closing_signed` too early, causing LDK<->LDK channels with an HTLC
pending towards the channel initiator at the time of `shutdown` to
always fail to cooperatively close.

To fix this race, we add an additional unpersisted bool to
`Channel` and use that to gate sending the initial `closing_signed`.
2023-11-11 20:24:58 +00:00
..
async_signer_tests.rs Add basic async signer tests 2023-11-01 15:24:20 -07:00
blinded_payment_tests.rs BOLT12 invoice_feature methods for ChannelManager 2023-10-20 09:49:56 -05:00
chan_utils.rs Use sign_holder_htlc_transaction to sign non-anchors holder HTLCs 2023-10-20 15:32:13 -07:00
chanmon_update_fail_tests.rs Immediately unblock channels on duplicate claims 2023-10-19 15:27:57 +00:00
channel.rs Don't send init closing_signed too early after final HTLC removal 2023-11-11 20:24:58 +00:00
channel_id.rs Add ChannelId pending change note; formatting 2023-08-28 07:20:23 +02:00
channelmanager.rs Handle retrying sign_counterparty_commitment failures 2023-11-01 15:24:14 -07:00
features.rs Makes Features::from_be_bytes public 2023-10-05 15:27:13 -04:00
functional_test_utils.rs Merge pull request #2558 from waterson/pr-2554 2023-11-02 19:04:05 +00:00
functional_tests.rs Handle sign_counterparty_commitment failing during outb funding 2023-11-01 14:41:02 -07:00
inbound_payment.rs Include PaymentId in payer metadata 2023-08-29 11:08:11 -05:00
mod.rs Add basic async signer tests 2023-11-01 15:24:20 -07:00
monitor_tests.rs Merge pull request #2667 from wpaulino/random-htlc-holder-sigs-non-anchors 2023-10-20 22:55:08 +00:00
msgs.rs Merge pull request #2039 from jkczyz/2023-02-offer-flow 2023-10-20 16:40:17 +00:00
onion_route_tests.rs Qualify BOLT11 ChannelManager invoice_features 2023-10-20 09:49:56 -05:00
onion_utils.rs next_hop_pubkey secp Verification only 2023-10-28 08:11:21 -07:00
outbound_payment.rs Apply a default max fee rather than none when paying for BOLT12 2023-10-20 18:09:09 +00:00
payment_tests.rs Merge pull request #2641 from alexanderwiederin/2585-preflight-test-coverage 2023-11-02 09:50:21 +01:00
peer_channel_encryptor.rs Move keysinterface.rs to a directory-level module called sign. 2023-05-02 21:48:08 -07:00
peer_handler.rs Do not compile the Simple* type aliases in c_bindings at all 2023-10-21 16:30:41 +00:00
priv_short_conf_tests.rs Qualify BOLT11 ChannelManager invoice_features 2023-10-20 09:49:56 -05:00
reload_tests.rs Merge pull request #2641 from alexanderwiederin/2585-preflight-test-coverage 2023-11-02 09:50:21 +01:00
reorg_tests.rs Test preimage claim after reorg of counterparty commitment 2023-09-29 09:58:38 -07:00
script.rs Use UserConfig to determine advertised InitFeatures by ChannelManager 2023-01-13 23:54:51 -08:00
shutdown_tests.rs Don't send init closing_signed too early after final HTLC removal 2023-11-11 20:24:58 +00:00
wire.rs Implement enqueue_message trait requirements on Message enum 2023-05-26 14:40:14 -07:00