Skip to content

Commit 8a67d7e

Browse files
committed
Handle InvoiceRequestFailed event
1 parent 9a3f169 commit 8a67d7e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/event.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,22 @@ where
983983
LdkEvent::DiscardFunding { .. } => {},
984984
LdkEvent::HTLCIntercepted { .. } => {},
985985
LdkEvent::BumpTransaction(_) => {},
986-
LdkEvent::InvoiceRequestFailed { .. } => {},
986+
LdkEvent::InvoiceRequestFailed { payment_id } => {
987+
log_error!(
988+
self.logger,
989+
"Failed to request invoice for outbound BOLT12 payment {}",
990+
payment_id
991+
);
992+
let update = PaymentDetailsUpdate {
993+
status: Some(PaymentStatus::Failed),
994+
..PaymentDetailsUpdate::new(payment_id)
995+
};
996+
self.payment_store.update(&update).unwrap_or_else(|e| {
997+
log_error!(self.logger, "Failed to access payment store: {}", e);
998+
panic!("Failed to access payment store");
999+
});
1000+
return;
1001+
},
9871002
LdkEvent::ConnectionNeeded { node_id, addresses } => {
9881003
let runtime_lock = self.runtime.read().unwrap();
9891004
debug_assert!(runtime_lock.is_some());

0 commit comments

Comments
 (0)