From: Valentine Wallace Date: Thu, 14 Sep 2023 03:52:11 +0000 (-0400) Subject: Rename onion util internal var X-Git-Tag: v0.0.117-alpha2~8^2~5 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=9ade8eb23b1cc9ac34cef5cf7031f9fc5bb21e9e;p=rust-lightning Rename onion util internal var This variable is ultimately for setting PaymentPathFailed::payment_failed_permanently, so use this name rather than flipping a bool back and forth. --- 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)]