@@ -415,8 +415,8 @@ where L::Target: Logger {
415
415
chacha. process ( & packet_decrypted, & mut decryption_tmp[ ..] ) ;
416
416
packet_decrypted = decryption_tmp;
417
417
418
- // The failing hop includes either the inbound channel to the recipient or the outbound
419
- // channel from the current hop (i.e., the next hop's inbound channel).
418
+ // The failing hop includes either the inbound channel to the recipient or the outbound channel
419
+ // from the current hop (i.e., the next hop's inbound channel).
420
420
is_from_final_node = route_hop_idx + 1 == path. hops . len ( ) ;
421
421
let failing_route_hop = if is_from_final_node { route_hop } else { & path. hops [ route_hop_idx + 1 ] } ;
422
422
@@ -432,8 +432,8 @@ where L::Target: Logger {
432
432
let error_code_slice = match err_packet. failuremsg . get ( 0 ..2 ) {
433
433
Some ( s) => s,
434
434
None => {
435
- // Useless packet that we can't use but it passed HMAC, so it
436
- // definitely came from the peer in question
435
+ // Useless packet that we can't use but it passed HMAC, so it definitely came from the peer
436
+ // in question
437
437
let network_update = Some ( NetworkUpdate :: NodeFailure {
438
438
node_id : route_hop. pubkey ,
439
439
is_permanent : true ,
@@ -454,8 +454,7 @@ where L::Target: Logger {
454
454
455
455
let ( debug_field, debug_field_size) = errors:: get_onion_debug_field ( error_code) ;
456
456
457
- // indicate that payment parameter has failed and no need to
458
- // update Route object
457
+ // indicate that payment parameter has failed and no need to update Route object
459
458
let payment_failed = match error_code & 0xff {
460
459
15 |16 |17 |18 |19 |23 => true ,
461
460
_ => false ,
@@ -465,14 +464,13 @@ where L::Target: Logger {
465
464
let mut short_channel_id = None ;
466
465
467
466
if error_code & BADONION == BADONION {
468
- // If the error code has the BADONION bit set, always blame the channel
469
- // from the node "originating" the error to its next hop. The
470
- // "originator" is ultimately actually claiming that its counterparty
471
- // is the one who is failing the HTLC.
472
- // If the "originator" here isn't lying we should really mark the
473
- // next-hop node as failed entirely, but we can't be confident in that,
474
- // as it would allow any node to get us to completely ban one of its
475
- // counterparties. Instead, we simply remove the channel in question.
467
+ // If the error code has the BADONION bit set, always blame the channel from the node
468
+ // "originating" the error to its next hop. The "originator" is ultimately actually claiming
469
+ // that its counterparty is the one who is failing the HTLC.
470
+ // If the "originator" here isn't lying we should really mark the next-hop node as failed
471
+ // entirely, but we can't be confident in that, as it would allow any node to get us to
472
+ // completely ban one of its counterparties. Instead, we simply remove the channel in
473
+ // question.
476
474
network_update = Some ( NetworkUpdate :: ChannelFailure {
477
475
short_channel_id : failing_route_hop. short_channel_id ,
478
476
is_permanent : true ,
@@ -579,16 +577,15 @@ where L::Target: Logger {
579
577
short_channel_id = Some ( route_hop. short_channel_id ) ;
580
578
}
581
579
} else if payment_failed {
582
- // Only blame the hop when a value in the HTLC doesn't match the
583
- // corresponding value in the onion.
580
+ // Only blame the hop when a value in the HTLC doesn't match the corresponding value in the
581
+ // onion.
584
582
short_channel_id = match error_code & 0xff {
585
583
18 |19 => Some ( route_hop. short_channel_id ) ,
586
584
_ => None ,
587
585
} ;
588
586
} else {
589
- // We can't understand their error messages and they failed to
590
- // forward...they probably can't understand our forwards so its
591
- // really not worth trying any further.
587
+ // We can't understand their error messages and they failed to forward...they probably can't
588
+ // understand our forwards so it's really not worth trying any further.
592
589
network_update = Some ( NetworkUpdate :: NodeFailure {
593
590
node_id : route_hop. pubkey ,
594
591
is_permanent : true ,
0 commit comments