X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Frouter.rs;h=f298f278439f284ccb15bcd66973eb94991d8174;hb=e32020c449964bc42cda264f510e7e51013f04bd;hp=85b65188a7f2d80ee96871004d36c540aaaaaad9;hpb=a9d73c2889d6ad33a8527778436633cb4173b63e;p=rust-lightning diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 85b65188..f298f278 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -14,7 +14,7 @@ use bitcoin::secp256k1::{PublicKey, Secp256k1, self}; use crate::blinded_path::{BlindedHop, BlindedPath}; use crate::blinded_path::payment::{ForwardNode, ForwardTlvs, PaymentConstraints, PaymentRelay, ReceiveTlvs}; use crate::ln::PaymentHash; -use crate::ln::channelmanager::{ChannelDetails, PaymentId}; +use crate::ln::channelmanager::{ChannelDetails, PaymentId, MIN_FINAL_CLTV_EXPIRY_DELTA}; use crate::ln::features::{BlindedHopFeatures, Bolt11InvoiceFeatures, Bolt12InvoiceFeatures, ChannelFeatures, NodeFeatures}; use crate::ln::msgs::{DecodeError, ErrorAction, LightningError, MAX_VALUE_MSAT}; use crate::offers::invoice::{BlindedPayInfo, Bolt12Invoice}; @@ -134,7 +134,8 @@ impl> + Clone, L: Deref, ES: Deref, S: Deref, }) .map(|forward_node| { BlindedPath::new_for_payment( - &[forward_node], recipient, tlvs.clone(), u64::MAX, &*self.entropy_source, secp_ctx + &[forward_node], recipient, tlvs.clone(), u64::MAX, MIN_FINAL_CLTV_EXPIRY_DELTA, + &*self.entropy_source, secp_ctx ) }) .take(MAX_PAYMENT_PATHS) @@ -144,8 +145,9 @@ impl> + Clone, L: Deref, ES: Deref, S: Deref, Ok(paths) if !paths.is_empty() => Ok(paths), _ => { if network_graph.nodes().contains_key(&NodeId::from_pubkey(&recipient)) { - BlindedPath::one_hop_for_payment(recipient, tlvs, &*self.entropy_source, secp_ctx) - .map(|path| vec![path]) + BlindedPath::one_hop_for_payment( + recipient, tlvs, MIN_FINAL_CLTV_EXPIRY_DELTA, &*self.entropy_source, secp_ctx + ).map(|path| vec![path]) } else { Err(()) }