From 42cf190f870587411d60dbb1a25abdc4b72b3c11 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 21 Dec 2018 11:54:35 -0500 Subject: [PATCH] Add TODO noting forward race condition --- src/ln/channelmanager.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index 3f67ea08e..6f3dbdabe 100644 --- a/src/ln/channelmanager.rs +++ b/src/ln/channelmanager.rs @@ -1189,9 +1189,12 @@ impl ChannelManager { let mut add_htlc_msgs = Vec::new(); let mut fail_htlc_msgs = Vec::new(); + //TODO: We should either randomize or sort pending_forwards before processing! for forward_info in pending_forwards.drain(..) { match forward_info { HTLCForwardInfo::AddHTLC { prev_short_channel_id, prev_htlc_id, forward_info } => { + // TODO: Double-check CLTV timeout before we forward as we may have + // gone through a serialize-wait-a-day-deserialize operation! log_trace!(self, "Adding HTLC from short id {} with payment_hash {} to channel with short id {} after delay", log_bytes!(forward_info.payment_hash.0), prev_short_channel_id, short_chan_id); let htlc_source = HTLCSource::PreviousHopData(HTLCPreviousHopData { short_channel_id: prev_short_channel_id, -- 2.39.5