File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -538,7 +538,7 @@ pub enum PaymentFailureReason {
538538InvoiceRequestRejected , 
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,7 +878,8 @@ pub enum Event {
878878/// [`Offer`]: crate::offers::offer::Offer 
879879payment_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. 
881+ /// by versions prior to 0.0.115, or when downgrading to 0.0.124 or later with a reason that 
882+ /// was added after. 
882883reason :  Option < PaymentFailureReason > , 
883884	} , 
884885	/// Indicates that a path for an outbound payment was successful. 
@@ -1939,7 +1940,7 @@ impl MaybeReadable for Event {
19391940					Ok ( Some ( Event :: PaymentFailed  { 
19401941						payment_id, 
19411942						payment_hash, 
1942- 						reason, 
1943+ 						reason :   _init_tlv_based_struct_field ! ( reason ,  upgradable_option ) , 
19431944					} ) ) 
19441945				} ; 
19451946				f ( ) 
Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ pub(crate) enum PendingOutboundPayment {
9696Abandoned  { 
9797		session_privs :  HashSet < [ u8 ;  32 ] > , 
9898		payment_hash :  PaymentHash , 
99- 		/// Will be `None` if the payment was serialized before 0.0.115. 
99+ 		/// Will be `None` if the payment was serialized before 0.0.115 or if downgrading to 0.0.124 
100+ /// or later with a reason that was added after. 
100101reason :  Option < PaymentFailureReason > , 
101102	} , 
102103} 
@@ -1940,7 +1941,7 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
19401941	} , 
19411942	( 3 ,  Abandoned )  => { 
19421943		( 0 ,  session_privs,  required) , 
1943- 		( 1 ,  reason,  option ) , 
1944+ 		( 1 ,  reason,  upgradable_option ) , 
19441945		( 2 ,  payment_hash,  required) , 
19451946	} , 
19461947	( 5 ,  AwaitingInvoice )  => { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments