Skip to content

Commit b050d77

Browse files
f use the right path when updating static invoices
1 parent 5ee74d4 commit b050d77

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lightning/src/offers/flow.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,13 +1222,20 @@ where
12221222
Ok((msg, ctx)) => (msg, ctx),
12231223
Err(()) => continue,
12241224
};
1225-
serve_static_invoice_messages.push((serve_invoice_msg, reply_path_ctx, offer_id));
1225+
serve_static_invoice_messages.push((
1226+
serve_invoice_msg,
1227+
update_static_invoice_path.clone(),
1228+
reply_path_ctx,
1229+
offer_id,
1230+
));
12261231
}
12271232
}
12281233

12291234
// Enqueue the new serve_static_invoice messages in a separate loop to avoid holding the offer
12301235
// cache lock and the pending_async_payments_messages lock at the same time.
1231-
for (serve_invoice_msg, reply_path_ctx, offer_id) in serve_static_invoice_messages {
1236+
for (serve_invoice_msg, serve_invoice_path, reply_path_ctx, offer_id) in
1237+
serve_static_invoice_messages
1238+
{
12321239
let context = MessageContext::AsyncPayments(reply_path_ctx);
12331240
let reply_paths = match self.create_blinded_paths(peers.clone(), context) {
12341241
Ok(paths) => paths,
@@ -1247,7 +1254,7 @@ where
12471254
let message = AsyncPaymentsMessage::ServeStaticInvoice(serve_invoice_msg);
12481255
enqueue_onion_message_with_reply_paths(
12491256
message,
1250-
&self.paths_to_static_invoice_server,
1257+
&[serve_invoice_path.into_reply_path()],
12511258
reply_paths,
12521259
&mut self.pending_async_payments_messages.lock().unwrap(),
12531260
);

lightning/src/onion_message/messenger.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,11 @@ impl Responder {
432432
context: Some(context),
433433
}
434434
}
435+
436+
/// Converts a [`Responder`] into its inner [`BlindedMessagePath`].
437+
pub(crate) fn into_reply_path(self) -> BlindedMessagePath {
438+
self.reply_path
439+
}
435440
}
436441

437442
/// Instructions for how and where to send the response to an onion message.

0 commit comments

Comments
 (0)