MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_add_label

Function json_add_label

plugins/offers_invreq_hook.c:149–161  ·  view source on GitHub ↗

We rely on label forms for uniqueness. */

Source from the content-addressed store, hash-verified

147
148/* We rely on label forms for uniqueness. */
149static void json_add_label(struct json_stream *js,
150 const struct sha256 *offer_id,
151 const struct pubkey *payer_key,
152 const u32 counter)
153{
154 char *label;
155
156 label = tal_fmt(tmpctx, "%s-%s-%u",
157 fmt_sha256(tmpctx, offer_id),
158 fmt_pubkey(tmpctx, payer_key),
159 counter);
160 json_add_string(js, "label", label);
161}
162
163/* Note: this can actually happen if a single-use offer is already
164 * used at the same time between the check and now.

Callers 2

create_invoicereqFunction · 0.85
check_previous_invoiceFunction · 0.85

Calls 3

fmt_sha256Function · 0.85
fmt_pubkeyFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected