@@ -4135,17 +4135,15 @@ where
4135
4135
#[cfg(async_payments)]
4136
4136
fn initiate_async_payment(
4137
4137
&self, invoice: &StaticInvoice, payment_id: PaymentId
4138
- ) -> Result<(), InvoiceError> {
4139
- if invoice.message_paths().is_empty() { return Err(Bolt12SemanticError::MissingPaths.into()) }
4140
-
4138
+ ) -> Result<(), Bolt12PaymentError> {
4141
4139
let reply_path = self.create_blinded_path(
4142
4140
MessageContext::AsyncPayments(AsyncPaymentsContext::OutboundPayment { payment_id })
4143
- ).map_err(|_| Bolt12SemanticError::MissingPaths )?;
4141
+ ).map_err(|_| Bolt12PaymentError::BlindedPathNotFound )?;
4144
4142
4145
4143
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
4146
4144
let payment_release_secret = self.pending_outbound_payments.static_invoice_received(
4147
4145
invoice, payment_id, &*self.entropy_source
4148
- ).map_err(|e| InvoiceError::from_string(format!("{:?}", e))) ?;
4146
+ )?;
4149
4147
4150
4148
let mut pending_async_payments_messages = self.pending_async_payments_messages.lock().unwrap();
4151
4149
const HTLC_AVAILABLE_LIMIT: usize = 10;
@@ -10684,22 +10682,16 @@ where
10684
10682
},
10685
10683
#[cfg(async_payments)]
10686
10684
OffersMessage::StaticInvoice(invoice) => {
10687
- let responder = match responder {
10688
- Some(responder) => responder,
10689
- None => return ResponseInstruction::NoResponse,
10690
- };
10691
10685
let payment_id = match context {
10692
10686
OffersContext::OutboundPayment { payment_id } => payment_id,
10693
10687
_ => {
10694
- return responder.respond(OffersMessage::InvoiceError(
10695
- InvoiceError::from_string("Unrecognized invoice".to_string())
10696
- ))
10688
+ return ResponseInstruction::NoResponse
10697
10689
}
10698
10690
};
10699
- match self.initiate_async_payment(&invoice, payment_id) {
10700
- Ok(()) => return ResponseInstruction::NoResponse,
10701
- Err(e) => responder.respond(OffersMessage::InvoiceError(e)),
10691
+ if let Err(e) = self.initiate_async_payment(&invoice, payment_id) {
10692
+ log_trace!(self.logger, "Failed to initiate async payment to static invoice: {:?}", e);
10702
10693
}
10694
+ ResponseInstruction::NoResponse
10703
10695
},
10704
10696
OffersMessage::InvoiceError(invoice_error) => {
10705
10697
abandon_if_payment(context);
0 commit comments