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

Function find_bolt

tools/check-bolt.c:239–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239static struct bolt_file *find_bolt(const char *bolt_prefix,
240 struct bolt_file *bolts)
241{
242 size_t i, n = tal_count(bolts);
243 int boltnum;
244 char *endp;
245
246 for (i = 0; i < n; i++)
247 if (streq(bolts[i].prefix, bolt_prefix))
248 return bolts+i;
249
250 /* Now search for numerical match. */
251 boltnum = strtol(bolt_prefix, &endp, 10);
252 if (endp != bolt_prefix && *endp == 0) {
253 for (i = 0; i < n; i++)
254 if (atoi(bolts[i].prefix) == boltnum)
255 return bolts+i;
256 }
257
258 return NULL;
259}
260
261int main(int argc, char *argv[])
262{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected