With channel scoring and payment retries, it is no longer necessary to
have expiry_too_far imply a payment failure.
let onion_packet = onion_utils::construct_onion_packet(onion_payloads, onion_keys, [0; 32], &payment_hash);
msg.cltv_expiry = htlc_cltv;
msg.onion_routing_packet = onion_packet;
- }, ||{}, true, Some(21), None);
+ }, ||{}, true, Some(21), Some(NetworkUpdate::NodeFailure{node_id: route.paths[0][0].pubkey, is_permanent: true}));
}
// indicate that payment parameter has failed and no need to
// update Route object
- let payment_failed = (match error_code & 0xff {
+ let payment_failed = match error_code & 0xff {
15|16|17|18|19 => true,
_ => false,
- } && is_from_final_node) // PERM bit observed below even this error is from the intermediate nodes
- || error_code == 21; // Special case error 21 as the Route object is bogus, TODO: Maybe fail the node if the CLTV was reasonable?
+ } && is_from_final_node; // PERM bit observed below even if this error is from the intermediate nodes
let mut network_update = None;