Skip to content

Commit

Permalink
Introduce reject_invoice_request
Browse files Browse the repository at this point in the history
  • Loading branch information
shaavan committed Sep 16, 2024
1 parent eaa5916 commit 3b7aa78
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4548,6 +4548,18 @@ where
Ok(())
}

/// Signals that the received [`InvoiceRequest`] must be rejected, and the corresponding
/// [`InvoiceError`], must be sent back to the counterparty.
pub fn reject_invoice_request(&self, reason: Bolt12SemanticError, responder: Responder) {
let mut pending_offers_message = self.pending_offers_messages.lock().unwrap();
let error = InvoiceError::from(reason);

let instructions = responder.respond().into_instructions();
let message = OffersMessage::InvoiceError(error);

pending_offers_message.push((message, instructions))
}

#[cfg(async_payments)]
fn initiate_async_payment(
&self, invoice: &StaticInvoice, payment_id: PaymentId
Expand Down

0 comments on commit 3b7aa78

Please sign in to comment.