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

Function unique_id_num

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

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

Callers 2

rune_unique_idFunction · 0.85
param_runeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected