Skip to content

Offers when offer_paths are present and offer_issuer_id is not needed #8238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions plugins/fetchinvoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ static struct command_result *handle_invreq_response(struct command *cmd,
badfield = "invoice_payment_hash";
goto badinv;
}
/* Currently the following check fails for offers that do not contain
* offer_issuer_id and for which an invoice is fetched from a CLN node,
* because listoffers_done in offers_invrek_hook.c sets invoice_node_id
* to offer_issuer_id regardless.
*/
if (!inv->invoice_node_id) {
badfield = "invoice_node_id";
goto badinv;
Expand Down
5 changes: 5 additions & 0 deletions plugins/offers_invreq_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,11 @@ static struct command_result *listoffers_done(struct command *cmd,
* - MUST set `invoice_node_id` to the `offer_issuer_id`
*/
/* FIXME: We always provide an offer_issuer_id! */
/* The following line is wrong when offer_issuer_id is not used.
* According to fetchinvoice.c, it should be "equal to the final
* `blinded_node_id` it [the payer] sent the invoice request to", when
* offer_issuer_id is not set and offer_paths is set
*/
ir->inv->invoice_node_id = ir->inv->offer_issuer_id;

/* BOLT #12:
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