From 5ef88cea34b9cf90fa5198b2ff4347e66e49a927 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 14 Sep 2018 13:35:56 -0400 Subject: [PATCH] Do not fail-backwards LocalAnnounced HTLCs upon force-close. This is completely unsafe as we have provided the remote side with a commitment_signed which they can broadcast, including the HTLC transaction, and then could claim it on-chain after we've failed it backwards! --- src/ln/channel.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ln/channel.rs b/src/ln/channel.rs index 3a627f35b..e71ba9b2c 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -2551,10 +2551,7 @@ impl Channel { } } - for htlc in self.pending_outbound_htlcs.drain(..) { - if htlc.state == OutboundHTLCState::LocalAnnounced { - dropped_outbound_htlcs.push((htlc.source, htlc.payment_hash)); - } + for _htlc in self.pending_outbound_htlcs.drain(..) { //TODO: Do something with the remaining HTLCs //(we need to have the ChannelManager monitor them so we can claim the inbound HTLCs //which correspond) -- 2.39.5