mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 09:34:24 +01:00
ccan: import latest
Which includes not asserting in timer.c should time go backwards. Fixes: #4401 Changelog-Fixed: lightningd: don't assert if time goes backwards temporarily. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
777f0b1145
commit
d06e84cceb
@@ -1,3 +1,3 @@
|
||||
CCAN imported from http://ccodearchive.net.
|
||||
|
||||
CCAN version: init-2503-g56d5c41f
|
||||
CCAN version: init-2504-g48b4ffc3
|
||||
|
||||
@@ -108,13 +108,10 @@ void timer_addrel(struct timers *timers, struct timer *t, struct timerel rel)
|
||||
|
||||
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;
|
||||
|
||||
@@ -346,7 +343,11 @@ struct timer *timers_expire(struct timers *timers, struct timemono expire)
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user