Skip to content

Commit ce81fdf

Browse files
committed
Always remove_path_inflight_htlcs when receiving PaymentPathFailed
1 parent 66e89b9 commit ce81fdf

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lightning-invoice/src/payment.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,23 +756,20 @@ where
756756
self.scorer.lock().payment_path_failed(&path, *short_channel_id);
757757
}
758758

759+
self.remove_path_inflight_htlcs(*payment_hash, path);
759760
if payment_id.is_none() {
760761
log_trace!(self.logger, "Payment {} has no id; not retrying", log_bytes!(payment_hash.0));
761-
self.remove_path_inflight_htlcs(*payment_hash, path);
762762
} else if *rejected_by_dest {
763763
log_trace!(self.logger, "Payment {} rejected by destination; not retrying", log_bytes!(payment_hash.0));
764764
self.payer.abandon_payment(payment_id.unwrap());
765-
self.remove_path_inflight_htlcs(*payment_hash, path);
766765
} else if retry.is_none() {
767766
log_trace!(self.logger, "Payment {} missing retry params; not retrying", log_bytes!(payment_hash.0));
768767
self.payer.abandon_payment(payment_id.unwrap());
769-
self.remove_path_inflight_htlcs(*payment_hash, path);
770768
} else if self.retry_payment(payment_id.unwrap(), *payment_hash, retry.as_ref().unwrap()).is_ok() {
771769
// We retried at least somewhat, don't provide the PaymentPathFailed event to the user.
772770
return;
773771
} else {
774772
self.payer.abandon_payment(payment_id.unwrap());
775-
self.remove_path_inflight_htlcs(*payment_hash, path);
776773
}
777774
},
778775
Event::PaymentFailed { payment_hash, .. } => {

0 commit comments

Comments
 (0)