@@ -383,13 +383,13 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
383
383
} && is_from_final_node) // PERM bit observed below even this error is from the intermediate nodes
384
384
|| error_code == 21 ; // Special case error 21 as the Route object is bogus, TODO: Maybe fail the node if the CLTV was reasonable?
385
385
386
- let mut fail_channel_update = None ;
386
+ let mut network_update = None ;
387
387
388
388
if error_code & NODE == NODE {
389
- fail_channel_update = Some ( NetworkUpdate :: NodeFailure { node_id : route_hop. pubkey , is_permanent : error_code & PERM == PERM } ) ;
389
+ network_update = Some ( NetworkUpdate :: NodeFailure { node_id : route_hop. pubkey , is_permanent : error_code & PERM == PERM } ) ;
390
390
}
391
391
else if error_code & PERM == PERM {
392
- fail_channel_update = if payment_failed { None } else { Some ( NetworkUpdate :: ChannelClosed {
392
+ network_update = if payment_failed { None } else { Some ( NetworkUpdate :: ChannelClosed {
393
393
short_channel_id : path[ next_route_hop_ix - if next_route_hop_ix == path. len ( ) { 1 } else { 0 } ] . short_channel_id ,
394
394
is_permanent : true ,
395
395
} ) } ;
@@ -413,7 +413,7 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
413
413
20 => chan_update. contents . flags & 2 == 0 ,
414
414
_ => false , // unknown error code; take channel_update as valid
415
415
} ;
416
- fail_channel_update = if is_chan_update_invalid {
416
+ network_update = if is_chan_update_invalid {
417
417
// This probably indicates the node which forwarded
418
418
// to the node in question corrupted something.
419
419
Some ( NetworkUpdate :: ChannelClosed {
@@ -428,10 +428,10 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
428
428
}
429
429
}
430
430
}
431
- if fail_channel_update . is_none ( ) {
431
+ if network_update . is_none ( ) {
432
432
// They provided an UPDATE which was obviously bogus, not worth
433
433
// trying to relay through them anymore.
434
- fail_channel_update = Some ( NetworkUpdate :: NodeFailure {
434
+ network_update = Some ( NetworkUpdate :: NodeFailure {
435
435
node_id : route_hop. pubkey ,
436
436
is_permanent : true ,
437
437
} ) ;
@@ -440,7 +440,7 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
440
440
// We can't understand their error messages and they failed to
441
441
// forward...they probably can't understand our forwards so its
442
442
// really not worth trying any further.
443
- fail_channel_update = Some ( NetworkUpdate :: NodeFailure {
443
+ network_update = Some ( NetworkUpdate :: NodeFailure {
444
444
node_id : route_hop. pubkey ,
445
445
is_permanent : true ,
446
446
} ) ;
@@ -449,7 +449,7 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
449
449
// TODO: Here (and a few other places) we assume that BADONION errors
450
450
// are always "sourced" from the node previous to the one which failed
451
451
// to decode the onion.
452
- res = Some ( ( fail_channel_update , !( error_code & PERM == PERM && is_from_final_node) ) ) ;
452
+ res = Some ( ( network_update , !( error_code & PERM == PERM && is_from_final_node) ) ) ;
453
453
454
454
let ( description, title) = errors:: get_onion_error_description ( error_code) ;
455
455
if debug_field_size > 0 && err_packet. failuremsg . len ( ) >= 4 + debug_field_size {
0 commit comments