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

Function datastore_key_startswith

wallet/datastore.c:12–24  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

10
11/* Does k1 match k2 as far as k2 goes? */
12bool datastore_key_startswith(const char **k1, const char **k2)
13{
14 size_t k1len = tal_count(k1), k2len = tal_count(k2);
15
16 if (k2len > k1len)
17 return false;
18
19 for (size_t i = 0; i < k2len; i++) {
20 if (!streq(k1[i], k2[i]))
21 return false;
22 }
23 return true;
24}
25
26bool datastore_key_eq(const char **k1, const char **k2)
27{

Callers 4

datastore_key_eqFunction · 0.85
db_datastore_nextFunction · 0.85
json_datastoreFunction · 0.85
json_listdatastoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected