Remove special case for onion error expiry_too_far
[rust-lightning] / lightning / src / ln / onion_utils.rs
index ee3ed96b5ef0efdcaaeda40a32f2e71653948ac0..f1b617fd94f3376810f4faeac69c9ce64702c27d 100644 (file)
@@ -377,11 +377,10 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(secp_ctx: &
 
                                                // 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;