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

Function timer_list_check

ccan/ccan/timer/timer.c:386–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386static bool timer_list_check(const struct list_head *l,
387 uint64_t min, uint64_t max, uint64_t first,
388 const char *abortstr)
389{
390 const struct timer *t;
391
392 if (!list_check(l, abortstr))
393 return false;
394
395 list_for_each(l, t, list) {
396 if (t->time < min || t->time > max) {
397 if (abortstr) {
398 fprintf(stderr,
399 "%s: timer %p %llu not %llu-%llu\n",
400 abortstr, t, (long long)t->time,
401 (long long)min, (long long)max);
402 abort();
403 }
404 return false;
405 }
406 if (t->time < first) {
407 if (abortstr) {
408 fprintf(stderr,
409 "%s: timer %p %llu < minimum %llu\n",
410 abortstr, t, (long long)t->time,
411 (long long)first);
412 abort();
413 }
414 return false;
415 }
416 }
417 return true;
418}
419
420struct timers *timers_check(const struct timers *timers, const char *abortstr)
421{

Callers 1

timers_checkFunction · 0.85

Calls 2

list_checkFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected