Skip to content

Commit 3b7aa78

Browse files
committed
Introduce reject_invoice_request
1 parent eaa5916 commit 3b7aa78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4548,6 +4548,18 @@ where
45484548
Ok(())
45494549
}
45504550

4551+
/// Signals that the received [`InvoiceRequest`] must be rejected, and the corresponding
4552+
/// [`InvoiceError`], must be sent back to the counterparty.
4553+
pub fn reject_invoice_request(&self, reason: Bolt12SemanticError, responder: Responder) {
4554+
let mut pending_offers_message = self.pending_offers_messages.lock().unwrap();
4555+
let error = InvoiceError::from(reason);
4556+
4557+
let instructions = responder.respond().into_instructions();
4558+
let message = OffersMessage::InvoiceError(error);
4559+
4560+
pending_offers_message.push((message, instructions))
4561+
}
4562+
45514563
#[cfg(async_payments)]
45524564
fn initiate_async_payment(
45534565
&self, invoice: &StaticInvoice, payment_id: PaymentId

0 commit comments

Comments
 (0)