Skip to content

Commit

Permalink
Don't generate redundant PaymentFailed events on abandon
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinewallace committed Feb 16, 2023
1 parent 17ca97b commit 6513398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightning/src/ln/outbound_payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ impl OutboundPayments {
) {
let mut outbounds = self.pending_outbound_payments.lock().unwrap();
if let hash_map::Entry::Occupied(mut payment) = outbounds.entry(payment_id) {
if let Ok(()) = payment.get_mut().mark_abandoned() {
if !payment.get().abandoned() && payment.get_mut().mark_abandoned().is_ok() {
if payment.get().remaining_parts() == 0 {
pending_events.lock().unwrap().push(events::Event::PaymentFailed {
payment_id,
Expand Down

0 comments on commit 6513398

Please sign in to comment.