X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Frouter.rs;h=da3b3d4eb1b0eb135858cd2dc9537c3c1c641a19;hb=9db962c7192643d10722b7b675d45068e14407c8;hp=36550bf99b96d2948aec80fc1862ed9fccd77fa1;hpb=21b0818be7c3f4b3fce24c2bd3ac0c156549f8bc;p=rust-lightning diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 36550bf9..da3b3d4e 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -621,8 +621,17 @@ impl PaymentParameters { /// /// The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has /// provided. - pub fn for_keysend(payee_pubkey: PublicKey, final_cltv_expiry_delta: u32) -> Self { - Self::from_node_id(payee_pubkey, final_cltv_expiry_delta).with_bolt11_features(InvoiceFeatures::for_keysend()).expect("PaymentParameters::from_node_id should always initialize the payee as unblinded") + /// + /// Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose + /// whether your router will be allowed to find a multi-part route for this payment. If you + /// set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via + /// [`RecipientOnionFields::secret_only`]. + /// + /// [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only + pub fn for_keysend(payee_pubkey: PublicKey, final_cltv_expiry_delta: u32, allow_mpp: bool) -> Self { + Self::from_node_id(payee_pubkey, final_cltv_expiry_delta) + .with_bolt11_features(InvoiceFeatures::for_keysend(allow_mpp)) + .expect("PaymentParameters::from_node_id should always initialize the payee as unblinded") } /// Includes the payee's features. Errors if the parameters were initialized with blinded payment @@ -794,7 +803,7 @@ impl ReadableArgs for Features { } /// A list of hops along a payment path terminating with a channel to the recipient. -#[derive(Clone, Debug, Hash, Eq, PartialEq)] +#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] pub struct RouteHint(pub Vec); impl Writeable for RouteHint { @@ -819,7 +828,7 @@ impl Readable for RouteHint { } /// A channel descriptor for a hop along a payment path. -#[derive(Clone, Debug, Hash, Eq, PartialEq)] +#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] pub struct RouteHintHop { /// The node_id of the non-target end of the route pub src_node_id: PublicKey,