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

Function datastore_key_startswith

lightningd/datastore.c:91–103  ·  view source on GitHub ↗

Does k1 match k2 as far as k2 goes? */

Source from the content-addressed store, hash-verified

89
90/* Does k1 match k2 as far as k2 goes? */
91static bool datastore_key_startswith(const char **k1, const char **k2)
92{
93 size_t k1len = tal_count(k1), k2len = tal_count(k2);
94
95 if (k2len > k1len)
96 return false;
97
98 for (size_t i = 0; i < k2len; i++) {
99 if (!streq(k1[i], k2[i]))
100 return false;
101 }
102 return true;
103}
104
105static bool datastore_key_eq(const char **k1, const char **k2)
106{

Callers 3

datastore_key_eqFunction · 0.85
json_datastoreFunction · 0.85
json_listdatastoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected