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

Function unique_id_num

lightningd/runes.c:53–70  ·  view source on GitHub ↗

Convert unique_id string to u64. We only expect this to fail when we're * dealing with runes from elsewhere (i.e. param_rune) */

Source from the content-addressed store, hash-verified

51/* Convert unique_id string to u64. We only expect this to fail when we're
52 * dealing with runes from elsewhere (i.e. param_rune) */
53static bool unique_id_num(const struct rune *rune, u64 *num)
54{
55 unsigned long long l;
56 char *end;
57
58 if (!rune->unique_id)
59 return false;
60 l = strtoull(rune->unique_id, &end, 0);
61 if (*end)
62 return false;
63
64 /* sqlite3 only does signed 64 bits, so don't exceed 63 bits. */
65 if (l > INT64_MAX)
66 return false;
67
68 *num = l;
69 return true;
70}
71
72u64 rune_unique_id(const struct rune *rune)
73{

Callers 2

rune_unique_idFunction · 0.85
param_runeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected