Skip to content

Commit 3ea992b

Browse files
committed
f Keep OutboundPayments::needs_abandon
1 parent c8ec48a commit 3ea992b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,14 @@ impl OutboundPayments {
12841284
});
12851285
}
12861286

1287+
#[rustfmt::skip]
1288+
pub(super) fn needs_abandon(&self) -> bool {
1289+
let outbounds = self.pending_outbound_payments.lock().unwrap();
1290+
outbounds.iter().any(|(_, pmt)|
1291+
!pmt.is_auto_retryable_now() && pmt.remaining_parts() == 0 && !pmt.is_fulfilled() &&
1292+
!pmt.is_awaiting_invoice())
1293+
}
1294+
12871295
#[rustfmt::skip]
12881296
fn find_initial_route<R: Deref, NS: Deref, IH, L: Deref>(
12891297
&self, payment_id: PaymentId, payment_hash: PaymentHash, recipient_onion: &RecipientOnionFields,

0 commit comments

Comments
 (0)