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

Function is_unique_id

lightningd/runes.c:261–273  ·  view source on GitHub ↗

The unique id is embedded with a special restriction with an empty field name */

Source from the content-addressed store, hash-verified

259
260/* The unique id is embedded with a special restriction with an empty field name */
261static bool is_unique_id(struct rune_restr **restrs, unsigned int index)
262{
263 /* must be the first restriction */
264 if (index != 0)
265 return false;
266
267 /* Must be the only alternative */
268 if (tal_count(restrs[index]->alterns) != 1)
269 return false;
270
271 /* Must have an empty field name */
272 return streq(restrs[index]->alterns[0]->fieldname, "");
273}
274
275static char *fmt_cond(const tal_t *ctx,
276 const struct rune_altern *alt,

Callers 1

json_add_runeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected