db: add invoicerequests table.

We no longer use offers for "I want to send you money", but we'll use
invoice_requests directly.  Create a new table for them, and
associated functions.

The "localofferid" for "pay" and "sendpay" is now "localinvreqid".
This is an experimental-only option, so document the change under
experimental only.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: JSON-RPC: `pay` and `sendpay` `localofferid` is now `localinvreqid`.
This commit is contained in:
Rusty Russell
2022-11-09 13:02:01 +10:30
committed by Christian Decker
parent 891cef7b2b
commit 02d7454226
20 changed files with 634 additions and 372 deletions

View File

@@ -92,7 +92,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
p->features = parent->features;
p->id = parent->id;
p->local_id = parent->local_id;
p->local_offer_id = parent->local_offer_id;
p->local_invreq_id = parent->local_invreq_id;
p->groupid = parent->groupid;
p->invstring = parent->invstring;
p->description = parent->description;
@@ -107,7 +107,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
p->description = NULL;
/* Caller must set this. */
p->local_id = NULL;
p->local_offer_id = NULL;
p->local_invreq_id = NULL;
p->groupid = 0;
}
@@ -1599,8 +1599,8 @@ static struct command_result *payment_createonion_success(struct command *cmd,
if (p->destination)
json_add_node_id(req->js, "destination", p->destination);
if (p->local_offer_id)
json_add_sha256(req->js, "localofferid", p->local_offer_id);
if (p->local_invreq_id)
json_add_sha256(req->js, "localinvreqid", p->local_invreq_id);
send_outreq(p->plugin, req);
return command_still_pending(cmd);