InvoiceRequestRejected,
}
-impl_writeable_tlv_based_enum!(PaymentFailureReason,
+impl_writeable_tlv_based_enum_upgradable!(PaymentFailureReason,
(0, RecipientRejected) => {},
(1, UnknownRequiredFeatures) => {},
(2, UserAbandoned) => {},
/// [`Offer`]: crate::offers::offer::Offer
payment_hash: Option<PaymentHash>,
/// The reason the payment failed. This is only `None` for events generated or serialized
- /// by versions prior to 0.0.115.
+ /// by versions prior to 0.0.115, or when downgrading to 0.0.124 or later with a reason that
+ /// was added after.
reason: Option<PaymentFailureReason>,
},
/// Indicates that a path for an outbound payment was successful.
Ok(Some(Event::PaymentFailed {
payment_id,
payment_hash,
- reason,
+ reason: _init_tlv_based_struct_field!(reason, upgradable_option),
}))
};
f()
Abandoned {
session_privs: HashSet<[u8; 32]>,
payment_hash: PaymentHash,
- /// Will be `None` if the payment was serialized before 0.0.115.
+ /// Will be `None` if the payment was serialized before 0.0.115 or if downgrading to 0.0.124
+ /// or later with a reason that was added after.
reason: Option<PaymentFailureReason>,
},
}
},
(3, Abandoned) => {
(0, session_privs, required),
- (1, reason, option),
+ (1, reason, upgradable_option),
(2, payment_hash, required),
},
(5, AwaitingInvoice) => {