@@ -530,12 +530,15 @@ pub enum PaymentFailureReason {
530530 UnexpectedError ,
531531 /// An invoice was received that required unknown features.
532532 UnknownRequiredFeatures ,
533+ /// A [`Bolt12Invoice`] was not received in a reasonable amount of time.
534+ InvoiceRequestExpired ,
533535}
534536
535537impl_writeable_tlv_based_enum ! ( PaymentFailureReason ,
536538 ( 0 , RecipientRejected ) => { } ,
537539 ( 1 , UnknownRequiredFeatures ) => { } ,
538540 ( 2 , UserAbandoned ) => { } ,
541+ ( 3 , InvoiceRequestExpired ) => { } ,
539542 ( 4 , RetriesExhausted ) => { } ,
540543 ( 6 , PaymentExpired ) => { } ,
541544 ( 8 , RouteNotFound ) => { } ,
@@ -870,8 +873,7 @@ pub enum Event {
870873 /// [`Offer`]: crate::offers::offer::Offer
871874 payment_hash : Option < PaymentHash > ,
872875 /// The reason the payment failed. This is only `None` for events generated or serialized
873- /// by versions prior to 0.0.115 or when deserializing an `Event::InvoiceRequestFailed`,
874- /// which was removed in 0.0.124.
876+ /// by versions prior to 0.0.115.
875877 reason : Option < PaymentFailureReason > ,
876878 } ,
877879 /// Indicates that a path for an outbound payment was successful.
@@ -2080,7 +2082,7 @@ impl MaybeReadable for Event {
20802082 Ok ( Some ( Event :: PaymentFailed {
20812083 payment_id : payment_id. 0 . unwrap ( ) ,
20822084 payment_hash : None ,
2083- reason : None ,
2085+ reason : Some ( PaymentFailureReason :: InvoiceRequestExpired ) ,
20842086 } ) )
20852087 } ;
20862088 f ( )
0 commit comments