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

Function timer_list_check

ccan/ccan/timer/timer.c:376–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376static bool timer_list_check(const struct list_head *l,
377 uint64_t min, uint64_t max, uint64_t first,
378 const char *abortstr)
379{
380 const struct timer *t;
381
382 if (!list_check(l, abortstr))
383 return false;
384
385 list_for_each(l, t, list) {
386 if (t->time < min || t->time > max) {
387 if (abortstr) {
388 fprintf(stderr,
389 "%s: timer %p %llu not %llu-%llu\n",
390 abortstr, t, (long long)t->time,
391 (long long)min, (long long)max);
392 abort();
393 }
394 return false;
395 }
396 if (t->time < first) {
397 if (abortstr) {
398 fprintf(stderr,
399 "%s: timer %p %llu < minimum %llu\n",
400 abortstr, t, (long long)t->time,
401 (long long)first);
402 abort();
403 }
404 return false;
405 }
406 }
407 return true;
408}
409
410struct timers *timers_check(const struct timers *timers, const char *abortstr)
411{

Callers 1

timers_checkFunction · 0.85

Calls 2

list_checkFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected