Skip to content

Commit 5a66f12

Browse files
f assert instead of debug_assert
1 parent 95c3fdd commit 5a66f12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,10 @@ impl OutboundPayments {
10281028
) -> Result<(), Bolt12PaymentError> where ES::Target: EntropySource {
10291029
macro_rules! abandon_with_entry {
10301030
($payment: expr, $reason: expr) => {
1031-
debug_assert!(matches!($payment.get(), PendingOutboundPayment::AwaitingInvoice { .. }));
1031+
assert!(
1032+
matches!($payment.get(), PendingOutboundPayment::AwaitingInvoice { .. }),
1033+
"Generating PaymentFailed for unexpected outbound payment type can result in funds loss"
1034+
);
10321035
pending_events.lock().unwrap().push_back((events::Event::PaymentFailed {
10331036
payment_id,
10341037
payment_hash: None,

0 commit comments

Comments
 (0)