@@ -538,7 +538,7 @@ pub enum PaymentFailureReason {
538538 InvoiceRequestRejected ,
539539}
540540
541- impl_writeable_tlv_based_enum ! ( PaymentFailureReason ,
541+ impl_writeable_tlv_based_enum_upgradable ! ( PaymentFailureReason ,
542542 ( 0 , RecipientRejected ) => { } ,
543543 ( 1 , UnknownRequiredFeatures ) => { } ,
544544 ( 2 , UserAbandoned ) => { } ,
@@ -878,8 +878,9 @@ pub enum Event {
878878 /// [`Offer`]: crate::offers::offer::Offer
879879 payment_hash : Option < PaymentHash > ,
880880 /// The reason the payment failed. This is only `None` for events generated or serialized
881- /// by versions prior to 0.0.115 or when deserializing an `Event::InvoiceRequestFailed`,
882- /// which was removed in 0.0.124.
881+ /// by versions prior to 0.0.115, when deserializing an `Event::InvoiceRequestFailed` (which
882+ /// was removed in 0.0.124), or when downgrading to 0.0.124 or later with a reason that was
883+ /// added after.
883884 reason : Option < PaymentFailureReason > ,
884885 } ,
885886 /// Indicates that a path for an outbound payment was successful.
@@ -1940,7 +1941,7 @@ impl MaybeReadable for Event {
19401941 Ok ( Some ( Event :: PaymentFailed {
19411942 payment_id,
19421943 payment_hash,
1943- reason,
1944+ reason : _init_tlv_based_struct_field ! ( reason , upgradable_option ) ,
19441945 } ) )
19451946 } ;
19461947 f ( )
0 commit comments