You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some(("Forwarding node has tampered with the intended HTLC values or origin node has an obsolete cltv_expiry_delta",0x1000 | 13,self.get_channel_update(chan).unwrap()))
986
-
}else{
987
-
None
988
-
}
989
-
}
982
+
983
+
if !chan.is_live(){// channel_disabled
984
+
breakSome(("Forwarding channel is not in a ready state.",0x1000 | 20,Some(self.get_channel_update(chan).unwrap())));
breakSome(("Prior hop has deviated from specified fees parameters or origin node has obsolete ones",0x1000 | 12,Some(self.get_channel_update(chan).unwrap())));
breakSome(("Forwarding node has tampered with the intended HTLC values or origin node has an obsolete cltv_expiry_delta",0x1000 | 13,Some(self.get_channel_update(chan).unwrap())));
995
+
}
996
+
let cur_height = self.latest_block_height.load(Ordering::Acquire)asu32 + 1;
997
+
// We want to have at least HTLC_FAIL_TIMEOUT_BLOCKS to fail prior to going on chain CLAIM_BUFFER blocks before expiration
998
+
if msg.cltv_expiry <= cur_height + CLTV_CLAIM_BUFFER + HTLC_FAIL_TIMEOUT_BLOCKSasu32{// expiry_too_soon
999
+
breakSome(("CLTV expiry is too close",0x1000 | 14,Some(self.get_channel_update(chan).unwrap())));
1000
+
}
1001
+
if msg.cltv_expiry > cur_height + CLTV_FAR_FAR_AWAYasu32{// expiry_too_far
1002
+
breakSome(("CLTV expiry is too far in the future",21,None));
0 commit comments