common: reltimer_arg to access a timer argument.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-10-07 14:27:05 +10:30 committed by Christian Decker
parent 09459a97c7
commit 3018113012
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,11 @@ struct oneshot *new_reltimer_(struct timers *timers,
return t;
}
void *reltimer_arg(struct oneshot *t)
{
return t->arg;
}
void timer_expired(tal_t *ctx, struct timer *timer)
{
struct oneshot *t = container_of(timer, struct oneshot, timer);

View File

@ -15,6 +15,9 @@ struct oneshot *new_reltimer_(struct timers *timers,
new_reltimer_((timers), (ctx), (relexpire), \
typesafe_cb(void, void *, (func), (arg)), (arg))
/* Get timer arg. */
void *reltimer_arg(struct oneshot *t);
void timer_expired(tal_t *ctx, struct timer *timer);
#endif /* LIGHTNING_COMMON_TIMEOUT_H */