X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fonion_utils.rs;h=6d9118e21a8e38529e4ab5f93f8109c5b21a1363;hb=3b67be235a46d8f9a9a6faf7ca7c5872ffbd8646;hp=1c45da14a382c78aef88acda8a1a3d56ea0c1dca;hpb=1276cc72de06a24ab7ce432f4662f2d954f3c1d0;p=rust-lightning diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs index 1c45da14..6d9118e2 100644 --- a/lightning/src/ln/onion_utils.rs +++ b/lightning/src/ln/onion_utils.rs @@ -7,7 +7,8 @@ // You may not use this file except in accordance with one or both of these // licenses. -use ln::channelmanager::{PaymentHash, PaymentSecret, HTLCSource}; +use ln::{PaymentHash, PaymentSecret}; +use ln::channelmanager::HTLCSource; use ln::msgs; use routing::router::RouteHop; use util::byte_utils; @@ -449,10 +450,10 @@ pub(super) fn process_onion_failure(secp_ctx: & let (description, title) = errors::get_onion_error_description(error_code); if debug_field_size > 0 && err_packet.failuremsg.len() >= 4 + debug_field_size { - log_warn!(logger, "Onion Error[{}({:#x}) {}({})] {}", title, error_code, debug_field, log_bytes!(&err_packet.failuremsg[4..4+debug_field_size]), description); + log_warn!(logger, "Onion Error[from {}: {}({:#x}) {}({})] {}", route_hop.pubkey, title, error_code, debug_field, log_bytes!(&err_packet.failuremsg[4..4+debug_field_size]), description); } else { - log_warn!(logger, "Onion Error[{}({:#x})] {}", title, error_code, description); + log_warn!(logger, "Onion Error[from {}: {}({:#x})] {}", route_hop.pubkey, title, error_code, description); } } else { // Useless packet that we can't use but it passed HMAC, so it @@ -477,7 +478,7 @@ pub(super) fn process_onion_failure(secp_ctx: & #[cfg(test)] mod tests { - use ln::channelmanager::PaymentHash; + use ln::PaymentHash; use ln::features::{ChannelFeatures, NodeFeatures}; use routing::router::{Route, RouteHop}; use ln::msgs;