Move HTLCFailChannelUpdate handling out-of-band
[rust-lightning] / src / ln / peer_handler.rs
index 76cc35f64c550b9b401faab6272a9d163383e821..81ef41cf789d05aff4f25f659e97f1716e324d5d 100644 (file)
@@ -615,10 +615,7 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
                                                                                        },
                                                                                        131 => {
                                                                                                let msg = try_potential_decodeerror!(msgs::UpdateFailHTLC::read(&mut reader));
-                                                                                               let chan_update = try_potential_handleerror!(self.message_handler.chan_handler.handle_update_fail_htlc(&peer.their_node_id.unwrap(), &msg));
-                                                                                               if let Some(update) = chan_update {
-                                                                                                       self.message_handler.route_handler.handle_htlc_fail_channel_update(&update);
-                                                                                               }
+                                                                                               try_potential_handleerror!(self.message_handler.chan_handler.handle_update_fail_htlc(&peer.their_node_id.unwrap(), &msg));
                                                                                        },
                                                                                        135 => {
                                                                                                let msg = try_potential_decodeerror!(msgs::UpdateFailMalformedHTLC::read(&mut reader));
@@ -906,6 +903,10 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
                                                }
                                                continue;
                                        },
+                                       Event::PaymentFailureNetworkUpdate { ref update } => {
+                                               self.message_handler.route_handler.handle_htlc_fail_channel_update(update);
+                                               continue;
+                                       },
                                        Event::HandleError { ref node_id, ref action } => {
                                                if let Some(ref action) = *action {
                                                        match *action {