]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add TODO noting forward race condition
authorMatt Corallo <git@bluematt.me>
Fri, 21 Dec 2018 16:54:35 +0000 (11:54 -0500)
committerMatt Corallo <git@bluematt.me>
Sat, 22 Dec 2018 12:04:50 +0000 (07:04 -0500)
src/ln/channelmanager.rs

index 3f67ea08e724577da39be264d6e32525a4f8cd70..6f3dbdabed12ea827cf8506c05639ee418399c99 100644 (file)
@@ -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,