You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we bubble up the payment context into PendingHTLCRouting::ReceiveKeysend
and check it when receiving a spontaneous payment prior to generating a
claimable event. Prior to this patch, we would have accepted out-of-context
keysends sent over blinded paths taken from our BOLT 12 invoices.
As a side effect of this, our blinded keysend success test cases now fail, so
those tests are now removed. Their coverage is re-added in future commits when
we add support for async receive, meaning we're able to receive blinded
keysends in the correct payment context.
While we could avoid storing the payment context for the purposes of this
bugfix, we go ahead and store it now because it will be needed when support for
receiving async payments is added.
panic!("short_channel_id == 0 should imply any pending_forward entries are of type Receive");
@@ -6228,6 +6234,12 @@ where
6228
6234
check_total_value!(purpose);
6229
6235
},
6230
6236
OnionPayload::Spontaneous(preimage) => {
6237
+
if payment_context.is_some() {
6238
+
if !matches!(payment_context, Some(PaymentContext::AsyncBolt12Offer(_))) {
6239
+
log_trace!(self.logger, "Failing new HTLC with payment_hash {}: received a keysend payment to a non-async payments context {:#?}", payment_hash, payment_context);
6240
+
}
6241
+
fail_htlc!(claimable_htlc, payment_hash);
6242
+
}
6231
6243
let purpose = events::PaymentPurpose::SpontaneousPayment(preimage);
0 commit comments