X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fonion_utils.rs;h=c591010ae4dd671a5e5ee42b4b0bb5efb61e8c44;hb=9ade8eb23b1cc9ac34cef5cf7031f9fc5bb21e9e;hp=666221b2dd47fbe400b506d7602435905f9a2010;hpb=daf79f515fd4344c4ca278782500cb876b61749c;p=rust-lightning diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs index 666221b2..c591010a 100644 --- a/lightning/src/ln/onion_utils.rs +++ b/lightning/src/ln/onion_utils.rs @@ -507,7 +507,7 @@ pub(super) fn process_onion_failure( is_permanent: true, }); let short_channel_id = Some(route_hop.short_channel_id); - res = Some((network_update, short_channel_id, !is_from_final_node)); + res = Some((network_update, short_channel_id, is_from_final_node)); return } }; @@ -659,7 +659,7 @@ pub(super) fn process_onion_failure( short_channel_id = Some(route_hop.short_channel_id); } - res = Some((network_update, short_channel_id, !(error_code & PERM == PERM && is_from_final_node))); + res = Some((network_update, short_channel_id, error_code & PERM == PERM && is_from_final_node)); let (description, title) = errors::get_onion_error_description(error_code); if debug_field_size > 0 && err_packet.failuremsg.len() >= 4 + debug_field_size { @@ -668,9 +668,9 @@ pub(super) fn process_onion_failure( log_info!(logger, "Onion Error[from {}: {}({:#x})] {}", route_hop.pubkey, title, error_code, description); } }).expect("Route that we sent via spontaneously grew invalid keys in the middle of it?"); - if let Some((network_update, short_channel_id, payment_retryable)) = res { + if let Some((network_update, short_channel_id, payment_failed_permanently)) = res { DecodedOnionFailure { - network_update, short_channel_id, payment_retryable, + network_update, short_channel_id, payment_retryable: !payment_failed_permanently, #[cfg(test)] onion_error_code: error_code_ret, #[cfg(test)]