You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Event::PaymentSent::fee_paid_msat can be None despite docs to the contrary #4639
The Event::PaymentSent::fee_paid_msat docs claim the field is never None (for events after v0.0.103), however abandon_payment -> HTLC(s) still in-flight -> successful claim_htlc -> Event::PaymentSent will have the field set to None.
It appears that PendingOutboundPayment::get_pending_fee_msat() only returns a value for PendingOutboundPayment::Retryable. In some sense, even though a payment might still succeed, PendingOutboundPayment::Abandoned "forgets" too much info, when it should instead preserve some data from PendingOutboundPayment::Retryable in case the payment actually goes through.
Ideally we don't forget the fees, so our accounting stays clean. If someone's relying on Event::PaymentSent::bolt12_invoice, they'll also lose that data unexpectedly.
Context
/// Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target/// and we got back the payment preimage for it)./// .../// # Failure Behavior and Persistence/// This event will eventually be replayed after failures-to-handle (i.e., the event handler/// returning `Err(ReplayEvent ())`) and will be persisted across restarts.PaymentSent{// .../// The total fee which was spent at intermediate hops in this payment, across all paths./// .../// This is only `None` for payments initiated on LDK versions prior to 0.0.103.fee_paid_msat:Option<u64>,// ...}
Following the docs, since we had no pending payments pre-0.0.103, we had an unwrap on this field:
match event {Event::PaymentSent{ fee_paid_msat, .. } => {// ..let fee_paid_msat =
fee_paid_msat.expect("No pending sends before 0.0.103");// ..}}
Activity
valentinewallace commentedon Jun 1, 2026
Oof. Thanks for pointing this out! Working on a fix
(FYI, w/r/t the BOLT 12 invoice -- that comes from the
HTLCSource, not thePendingOutboundPayment, so we should be good in that regard.)