]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Log errors forwarding/failing HTLCs
authorMatt Corallo <git@bluematt.me>
Fri, 21 Dec 2018 18:40:51 +0000 (13:40 -0500)
committerMatt Corallo <git@bluematt.me>
Sat, 22 Dec 2018 12:03:17 +0000 (07:03 -0500)
src/ln/channelmanager.rs

index 3f67ea08e724577da39be264d6e32525a4f8cd70..0b7def9ad87bf8b02a9ae22565d9854de2617144 100644 (file)
@@ -1200,7 +1200,9 @@ impl ChannelManager {
                                                                });
                                                                match forward_chan.send_htlc(forward_info.amt_to_forward, forward_info.payment_hash, forward_info.outgoing_cltv_value, htlc_source.clone(), forward_info.onion_packet.unwrap()) {
                                                                        Err(e) => {
-                                                                               if let ChannelError::Ignore(_) = e {} else {
+                                                                               if let ChannelError::Ignore(msg) = e {
+                                                                                       log_trace!(self, "Failed to forward HTLC with payment_hash {}: {}", log_bytes!(forward_info.payment_hash.0), msg);
+                                                                               } else {
                                                                                        panic!("Stated return value requirements in send_htlc() were not met");
                                                                                }
                                                                                let chan_update = self.get_channel_update(forward_chan).unwrap();
@@ -1227,7 +1229,9 @@ impl ChannelManager {
                                                                log_trace!(self, "Failing HTLC back to channel with short id {} after delay", short_chan_id);
                                                                match forward_chan.get_update_fail_htlc(htlc_id, err_packet) {
                                                                        Err(e) => {
-                                                                               if let ChannelError::Ignore(_) = e {} else {
+                                                                               if let ChannelError::Ignore(msg) = e {
+                                                                                       log_trace!(self, "Failed to fail backwards to short_id {}: {}", short_chan_id, msg);
+                                                                               } else {
                                                                                        panic!("Stated return value requirements in get_update_fail_htlc() were not met");
                                                                                }
                                                                                // fail-backs are best-effort, we probably already have one