@@ -11049,6 +11049,29 @@ mod tests {
11049
11049
sender_intended_amt_msat - extra_fee_msat, 42, None, true, Some(extra_fee_msat)).is_ok());
11050
11050
}
11051
11051
11052
+ #[test]
11053
+ fn test_final_incorrect_cltv(){
11054
+ let chanmon_cfg = create_chanmon_cfgs(1);
11055
+ let node_cfg = create_node_cfgs(1, &chanmon_cfg);
11056
+ let node_chanmgr = create_node_chanmgrs(1, &node_cfg, &[None]);
11057
+ let node = create_network(1, &node_cfg, &node_chanmgr);
11058
+
11059
+ let result = node[0].node.construct_recv_pending_htlc_info(msgs::InboundOnionPayload::Receive {
11060
+ amt_msat: 100,
11061
+ outgoing_cltv_value: 10,
11062
+ payment_metadata: None,
11063
+ keysend_preimage: None,
11064
+ payment_data: Some(msgs::FinalOnionHopData {
11065
+ payment_secret: PaymentSecret([0; 32]), total_msat: 100,
11066
+ }),
11067
+ custom_tlvs: Vec::new(),
11068
+ }, [0; 32], PaymentHash([0; 32]), 100, 11, None, true, None);
11069
+
11070
+ if let Err(crate::ln::channelmanager::InboundOnionErr { msg, .. }) = result {
11071
+ assert_eq!(msg, "The final CLTV expiry is too soon to handle");
11072
+ } else { panic!(); }
11073
+ }
11074
+
11052
11075
#[test]
11053
11076
fn test_inbound_anchors_manual_acceptance() {
11054
11077
// Tests that we properly limit inbound channels when we have the manual-channel-acceptance
0 commit comments