Skip to content
Open
10 changes: 7 additions & 3 deletions plugins/offers_invreq_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,11 +931,15 @@ static struct command_result *listoffers_done(struct command *cmd,
assert(ir->inv->invreq_payer_id);

/* BOLT #12:
* - if `offer_issuer_id` is present:
* - if `offer_issuer_id` is present or if `offer_paths` is not present:
* - MUST set `invoice_node_id` to the `offer_issuer_id`
* - else:
* - MUST set `invoice_node_id` to the final `blinded_node_id`
*/
/* FIXME: We always provide an offer_issuer_id! */
ir->inv->invoice_node_id = ir->inv->offer_issuer_id;
if(!ir->inv->offer_issuer_id && ir->invreq->offer_paths) {
ir->inv->invoice_node_id = &(*ir->invreq->offer_paths)->path[tal_count((*ir->invreq->offer_paths)->path)-1]->blinded_node_id;

} else ir->inv->invoice_node_id = ir->inv->offer_issuer_id;

/* BOLT #12:
* - MUST set `invoice_created_at` to the number of seconds since
Expand Down
6 changes: 6 additions & 0 deletions plugins/offers_offer.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,12 @@ static struct command_result *found_best_peer(struct command *cmd,
struct secret blinding_path_secret;
struct sha256 offer_id;

/* offer_issuer_id is not needed when offer_paths are used.
* The following line seems to produce a valid offer with
* offer_issuer_id removed.
*/
offinfo->offer->offer_issuer_id = NULL;

/* Note: "id" of offer minus paths */
offer_offer_id(offinfo->offer, &offer_id);

Expand Down
Loading