From c662dd3e946749f2c4a4c7e3169963d4e7906048 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 24 Oct 2018 00:44:15 -0400 Subject: [PATCH 1/2] Fix XXXs that slipped into router and handle HTLCFailCHannelUpdates --- src/ln/router.rs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/ln/router.rs b/src/ln/router.rs index 4c3bcb98074..0d049f5a78d 100644 --- a/src/ln/router.rs +++ b/src/ln/router.rs @@ -349,18 +349,25 @@ impl RoutingMessageHandler for Router { &msgs::HTLCFailChannelUpdate::ChannelUpdateMessage { ref msg } => { let _ = self.handle_channel_update(msg); }, - &msgs::HTLCFailChannelUpdate::ChannelClosed { ref short_channel_id, is_permanent:_ } => { -//XXX + &msgs::HTLCFailChannelUpdate::ChannelClosed { ref short_channel_id, ref is_permanent } => { let mut network = self.network_map.write().unwrap(); - if let Some(chan) = network.channels.remove(short_channel_id) { - Self::remove_channel_in_nodes(&mut network.nodes, &chan, *short_channel_id); + if *is_permanent { + if let Some(chan) = network.channels.remove(short_channel_id) { + Self::remove_channel_in_nodes(&mut network.nodes, &chan, *short_channel_id); + } + } else { + if let Some(chan) = network.channels.get_mut(short_channel_id) { + chan.one_to_two.enabled = false; + chan.two_to_one.enabled = false; + } } }, - &msgs::HTLCFailChannelUpdate::NodeFailure { ref node_id, is_permanent:_ } => { -//XXX - //let mut network = self.network_map.write().unwrap(); - //TODO: check _blamed_upstream_node - self.mark_node_bad(node_id, false); + &msgs::HTLCFailChannelUpdate::NodeFailure { ref node_id, ref is_permanent } => { + if *is_permanent { + //TODO: Wholly remove the node + } else { + self.mark_node_bad(node_id, false); + } }, } } From fc8cd9f142a8b39ef92675526dde4ff413095b76 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 25 Oct 2018 14:33:10 -0400 Subject: [PATCH 2/2] Run travis-fuzz on Rust 1.29.2 due to 1.30 breaking honggfuzz build --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6a21dfa0b3a..efdff130b0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ rust: - stable - beta - 1.22.0 + - 1.29.2 cache: cargo before_install: @@ -12,4 +13,4 @@ before_install: script: - cargo build --verbose - cargo test --verbose - - if [ "$(rustup show | grep default | grep stable)" != "" ]; then cd fuzz && cargo test --verbose && ./travis-fuzz.sh; fi + - if [ "$(rustup show | grep default | grep 1.29.2)" != "" ]; then cd fuzz && cargo test --verbose && ./travis-fuzz.sh; fi