Skip to content

Commit ed444c4

Browse files
Rename onion util internal var
recipient_rejected is more specific than payment_retryable and is more in line with our other internal verbiage like FailureReason::RecipientRejected.
1 parent daf79f5 commit ed444c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
507507
is_permanent: true,
508508
});
509509
let short_channel_id = Some(route_hop.short_channel_id);
510-
res = Some((network_update, short_channel_id, !is_from_final_node));
510+
res = Some((network_update, short_channel_id, is_from_final_node));
511511
return
512512
}
513513
};
@@ -659,7 +659,7 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
659659
short_channel_id = Some(route_hop.short_channel_id);
660660
}
661661

662-
res = Some((network_update, short_channel_id, !(error_code & PERM == PERM && is_from_final_node)));
662+
res = Some((network_update, short_channel_id, error_code & PERM == PERM && is_from_final_node));
663663

664664
let (description, title) = errors::get_onion_error_description(error_code);
665665
if debug_field_size > 0 && err_packet.failuremsg.len() >= 4 + debug_field_size {
@@ -668,9 +668,9 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
668668
log_info!(logger, "Onion Error[from {}: {}({:#x})] {}", route_hop.pubkey, title, error_code, description);
669669
}
670670
}).expect("Route that we sent via spontaneously grew invalid keys in the middle of it?");
671-
if let Some((network_update, short_channel_id, payment_retryable)) = res {
671+
if let Some((network_update, short_channel_id, recipient_rejected)) = res {
672672
DecodedOnionFailure {
673-
network_update, short_channel_id, payment_retryable,
673+
network_update, short_channel_id, payment_retryable: !recipient_rejected,
674674
#[cfg(test)]
675675
onion_error_code: error_code_ret,
676676
#[cfg(test)]

0 commit comments

Comments
 (0)