From: Matt Corallo Date: Fri, 21 Dec 2018 16:54:35 +0000 (-0500) Subject: Add TODO noting forward race condition X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=42cf190f870587411d60dbb1a25abdc4b72b3c11;p=rust-lightning Add TODO noting forward race condition --- 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,