Skip to content

Commit b5573e7

Browse files
Add new PaymentFailureReason::BlindedPathCreationFailed.
RouteNotFound did not fit here because that error is reserved for failing to find a route for a payment, whereas here we are failing to create a blinded path back to ourselves..
1 parent 903d8f0 commit b5573e7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lightning/src/events/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,12 @@ pub enum PaymentFailureReason {
575575
///
576576
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
577577
InvoiceRequestRejected,
578+
/// Failed to create a blinded path back to ourselves.
579+
/// We attempted to initiate payment to a static invoice but failed to create a reply path for our
580+
/// [`HeldHtlcAvailable`] message.
581+
///
582+
/// [`HeldHtlcAvailable`]: crate::onion_message::async_payments::HeldHtlcAvailable
583+
BlindedPathCreationFailed,
578584
}
579585

580586
impl_writeable_tlv_based_enum_upgradable!(PaymentFailureReason,
@@ -587,6 +593,7 @@ impl_writeable_tlv_based_enum_upgradable!(PaymentFailureReason,
587593
(6, PaymentExpired) => {},
588594
(8, RouteNotFound) => {},
589595
(10, UnexpectedError) => {},
596+
(12, BlindedPathCreationFailed) => {},
590597
);
591598

592599
/// An Event which you should probably take some action in response to.
@@ -1619,6 +1626,8 @@ impl Writeable for Event {
16191626
&Some(PaymentFailureReason::RetriesExhausted),
16201627
Some(PaymentFailureReason::InvoiceRequestRejected) =>
16211628
&Some(PaymentFailureReason::RecipientRejected),
1629+
Some(PaymentFailureReason::BlindedPathCreationFailed) =>
1630+
&Some(PaymentFailureReason::RouteNotFound)
16221631
};
16231632
write_tlv_fields!(writer, {
16241633
(0, payment_id, required),

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4380,7 +4380,7 @@ where
43804380
) {
43814381
Ok(paths) => paths,
43824382
Err(()) => {
4383-
self.abandon_payment_with_reason(payment_id, PaymentFailureReason::RouteNotFound);
4383+
self.abandon_payment_with_reason(payment_id, PaymentFailureReason::BlindedPathCreationFailed);
43844384
res = Err(Bolt12PaymentError::BlindedPathCreationFailed);
43854385
return NotifyOption::DoPersist
43864386
}

0 commit comments

Comments
 (0)