Skip to content

Commit 658e2c0

Browse files
Support sending keysend payments to blinded paths.
1 parent f5ee8c2 commit 658e2c0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lightning/src/ln/msgs.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,7 @@ mod fuzzy_internal_msgs {
17161716
cltv_expiry_height: u32,
17171717
encrypted_tlvs: Vec<u8>,
17181718
intro_node_blinding_point: Option<PublicKey>, // Set if the introduction node of the blinded path is the final node
1719+
keysend_preimage: Option<PaymentPreimage>,
17191720
}
17201721
}
17211722

@@ -2503,14 +2504,15 @@ impl Writeable for OutboundOnionPayload {
25032504
},
25042505
Self::BlindedReceive {
25052506
sender_intended_htlc_amt_msat, total_msat, cltv_expiry_height, encrypted_tlvs,
2506-
intro_node_blinding_point,
2507+
intro_node_blinding_point, keysend_preimage,
25072508
} => {
25082509
_encode_varint_length_prefixed_tlv!(w, {
25092510
(2, HighZeroBytesDroppedBigSize(*sender_intended_htlc_amt_msat), required),
25102511
(4, HighZeroBytesDroppedBigSize(*cltv_expiry_height), required),
25112512
(10, *encrypted_tlvs, required_vec),
25122513
(12, intro_node_blinding_point, option),
2513-
(18, HighZeroBytesDroppedBigSize(*total_msat), required)
2514+
(18, HighZeroBytesDroppedBigSize(*total_msat), required),
2515+
(5482373484, keysend_preimage, option)
25142516
});
25152517
},
25162518
}

lightning/src/ln/onion_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ pub(super) fn build_onion_payloads(
213213
cltv_expiry_height: cur_cltv + excess_final_cltv_expiry_delta,
214214
encrypted_tlvs: blinded_hop.encrypted_payload.clone(),
215215
intro_node_blinding_point: blinding_point.take(),
216+
keysend_preimage: *keysend_preimage,
216217
});
217218
} else {
218219
res.push(msgs::OutboundOnionPayload::BlindedForward {

0 commit comments

Comments
 (0)