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");
@@ -6256,6 +6262,12 @@ where
6256
6262
check_total_value!(purpose);
6257
6263
},
6258
6264
OnionPayload::Spontaneous(preimage) => {
6265
+
if payment_context.is_some() {
6266
+
if !matches!(payment_context, Some(PaymentContext::AsyncBolt12Offer(_))) {
6267
+
log_trace!(self.logger, "Failing new HTLC with payment_hash {}: received a keysend payment to a non-async payments context {:#?}", payment_hash, payment_context);
6268
+
}
6269
+
fail_htlc!(claimable_htlc, payment_hash);
6270
+
}
6259
6271
let purpose = events::PaymentPurpose::SpontaneousPayment(preimage);
0 commit comments