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
After a lot of setup in prior commits, here we finally finish support for
receiving HTLCs paid to static BOLT 12 invoices. It amounts to verifying the
invoice request contained within the onion and generating the right
PaymentPurpose for the claimable event.
if !matches!(payment_context, Some(PaymentContext::AsyncBolt12Offer(_))) {
6277
-
log_trace!(self.logger, "Failing new HTLC with payment_hash {}: received a keysend payment to a non-async payments context {:#?}", payment_hash, payment_context);
6273
+
OnionPayload::Spontaneous(keysend_preimage) => {
6274
+
let purpose = if let Some(PaymentContext::AsyncBolt12Offer(
6275
+
AsyncBolt12OfferContext { offer_nonce }
6276
+
)) = payment_context {
6277
+
let payment_data = match payment_data {
6278
+
Some(data) => data,
6279
+
None => {
6280
+
debug_assert!(false, "We checked that payment_data is Some above");
log_trace!(self.logger, "Failing new HTLC with payment_hash {}: received a keysend payment to a non-async payments context {:#?}", payment_hash, payment_context);
6279
6317
fail_htlc!(claimable_htlc, payment_hash);
6280
-
}
6281
-
let purpose = events::PaymentPurpose::SpontaneousPayment(preimage);
0 commit comments