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

Function is_unique_id

lightningd/runes.c:254–266  ·  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

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

Callers 1

json_add_runeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected