Skip to content

Commit 154aa21

Browse files
Parse keysend preimages in blinded onion payloads.
1 parent 658e2c0 commit 154aa21

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lightning/src/ln/msgs.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,7 @@ mod fuzzy_internal_msgs {
16881688
payment_secret: PaymentSecret,
16891689
payment_constraints: PaymentConstraints,
16901690
intro_node_blinding_point: Option<PublicKey>,
1691+
keysend_preimage: Option<PaymentPreimage>,
16911692
}
16921693
}
16931694

@@ -2562,9 +2563,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
25622563
}
25632564

25642565
if let Some(blinding_point) = intro_node_blinding_point.or(update_add_blinding_point) {
2565-
if short_id.is_some() || payment_data.is_some() || payment_metadata.is_some() ||
2566-
keysend_preimage.is_some()
2567-
{
2566+
if short_id.is_some() || payment_data.is_some() || payment_metadata.is_some() {
25682567
return Err(DecodeError::InvalidValue)
25692568
}
25702569
let enc_tlvs = encrypted_tlvs_opt.ok_or(DecodeError::InvalidValue)?.0;
@@ -2577,7 +2576,9 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
25772576
ChaChaPolyReadAdapter { readable: BlindedPaymentTlvs::Forward(ForwardTlvs {
25782577
short_channel_id, payment_relay, payment_constraints, features
25792578
})} => {
2580-
if amt.is_some() || cltv_value.is_some() || total_msat.is_some() {
2579+
if amt.is_some() || cltv_value.is_some() || total_msat.is_some() ||
2580+
keysend_preimage.is_some()
2581+
{
25812582
return Err(DecodeError::InvalidValue)
25822583
}
25832584
Ok(Self::BlindedForward {
@@ -2599,6 +2600,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
25992600
payment_secret,
26002601
payment_constraints,
26012602
intro_node_blinding_point,
2603+
keysend_preimage,
26022604
})
26032605
},
26042606
}

0 commit comments

Comments
 (0)