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

Function json_add_label

plugins/offers_invreq_hook.c:137–150  ·  view source on GitHub ↗

We rely on label forms for uniqueness. */

Source from the content-addressed store, hash-verified

135
136/* We rely on label forms for uniqueness. */
137static void json_add_label(struct json_stream *js,
138 const struct sha256 *offer_id,
139 const struct point32 *payer_key,
140 const u32 counter)
141{
142 char *label;
143
144 label = tal_fmt(tmpctx, "%s-%s-%u",
145 type_to_string(tmpctx, struct sha256, offer_id),
146 type_to_string(tmpctx, struct point32,
147 payer_key),
148 counter);
149 json_add_string(js, "label", label);
150}
151
152/* Note: this can actually happen if a single-use offer is already
153 * used at the same time between the check and now.

Callers 2

create_invoicereqFunction · 0.85
check_previous_invoiceFunction · 0.85

Calls 2

type_to_stringClass · 0.50
json_add_stringFunction · 0.50

Tested by

no test coverage detected