As seen in https://github.com/ElementsProject/lightning/issues/4401
OpenBSD 6.8 inside VirtualBox.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
t->time = time_to_grains(timemono_add(time_mono(), rel));
-#if TIME_HAVE_MONOTONIC
- assert(t->time >= timers->base);
-#else
/* Added in the past? Treat it as imminent. */
if (t->time < timers->base)
t->time = timers->base;
-#endif
+
if (t->time < timers->first)
timers->first = t->time;
unsigned int off;
struct timer *t;
- assert(now >= timers->base);
+ /* This can happen without TIME_HAVE_MONOTONIC, but I also have
+ * a report of OpenBSD 6.8 under virtualbox doing this. */
+ if (now < timers->base) {
+ return NULL;
+ }
if (!timers->level[0]) {
if (list_empty(&timers->far))