@@ -538,7 +538,7 @@ pub enum PaymentFailureReason {
538
538
InvoiceRequestRejected ,
539
539
}
540
540
541
- impl_writeable_tlv_based_enum ! ( PaymentFailureReason ,
541
+ impl_writeable_tlv_based_enum_upgradable ! ( PaymentFailureReason ,
542
542
( 0 , RecipientRejected ) => { } ,
543
543
( 1 , UnknownRequiredFeatures ) => { } ,
544
544
( 2 , UserAbandoned ) => { } ,
@@ -878,8 +878,9 @@ pub enum Event {
878
878
/// [`Offer`]: crate::offers::offer::Offer
879
879
payment_hash : Option < PaymentHash > ,
880
880
/// 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.
883
884
reason : Option < PaymentFailureReason > ,
884
885
} ,
885
886
/// Indicates that a path for an outbound payment was successful.
@@ -1934,7 +1935,7 @@ impl MaybeReadable for Event {
1934
1935
Ok ( Some ( Event :: PaymentFailed {
1935
1936
payment_id,
1936
1937
payment_hash : invoice_received. then ( || payment_hash) ,
1937
- reason,
1938
+ reason : _init_tlv_based_struct_field ! ( reason , upgradable_option ) ,
1938
1939
} ) )
1939
1940
} ;
1940
1941
f ( )
0 commit comments