]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Do not fail-backwards LocalAnnounced HTLCs upon force-close.
authorMatt Corallo <git@bluematt.me>
Fri, 14 Sep 2018 17:35:56 +0000 (13:35 -0400)
committerMatt Corallo <git@bluematt.me>
Fri, 14 Sep 2018 19:27:53 +0000 (15:27 -0400)
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

index 3a627f35baa9548881e8e52f8b1f888abff791a6..e71ba9b2c63f151351d60f9f9ce9f46c91620b39 100644 (file)
@@ -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)