From: Valentine Wallace Date: Wed, 13 Mar 2024 19:43:23 +0000 (-0400) Subject: Support sending keysend payments to blinded paths. X-Git-Tag: v0.0.123-beta~31^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=658e2c0a48b50adb522cea30e05d88e824d45bd3;p=rust-lightning Support sending keysend payments to blinded paths. --- diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index d291ac866..a30bea5d3 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -1716,6 +1716,7 @@ mod fuzzy_internal_msgs { cltv_expiry_height: u32, encrypted_tlvs: Vec, intro_node_blinding_point: Option, // Set if the introduction node of the blinded path is the final node + keysend_preimage: Option, } } @@ -2503,14 +2504,15 @@ impl Writeable for OutboundOnionPayload { }, Self::BlindedReceive { sender_intended_htlc_amt_msat, total_msat, cltv_expiry_height, encrypted_tlvs, - intro_node_blinding_point, + intro_node_blinding_point, keysend_preimage, } => { _encode_varint_length_prefixed_tlv!(w, { (2, HighZeroBytesDroppedBigSize(*sender_intended_htlc_amt_msat), required), (4, HighZeroBytesDroppedBigSize(*cltv_expiry_height), required), (10, *encrypted_tlvs, required_vec), (12, intro_node_blinding_point, option), - (18, HighZeroBytesDroppedBigSize(*total_msat), required) + (18, HighZeroBytesDroppedBigSize(*total_msat), required), + (5482373484, keysend_preimage, option) }); }, } diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs index c705c4afd..53ef0729a 100644 --- a/lightning/src/ln/onion_utils.rs +++ b/lightning/src/ln/onion_utils.rs @@ -213,6 +213,7 @@ pub(super) fn build_onion_payloads( cltv_expiry_height: cur_cltv + excess_final_cltv_expiry_delta, encrypted_tlvs: blinded_hop.encrypted_payload.clone(), intro_node_blinding_point: blinding_point.take(), + keysend_preimage: *keysend_preimage, }); } else { res.push(msgs::OutboundOnionPayload::BlindedForward {