Skip to content

Commit 3018113

Browse files
rustyrussellcdecker
authored andcommitted
common: reltimer_arg to access a timer argument.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 09459a9 commit 3018113

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

common/timeout.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ struct oneshot *new_reltimer_(struct timers *timers,
3030
return t;
3131
}
3232

33+
void *reltimer_arg(struct oneshot *t)
34+
{
35+
return t->arg;
36+
}
37+
3338
void timer_expired(tal_t *ctx, struct timer *timer)
3439
{
3540
struct oneshot *t = container_of(timer, struct oneshot, timer);

common/timeout.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ struct oneshot *new_reltimer_(struct timers *timers,
1515
new_reltimer_((timers), (ctx), (relexpire), \
1616
typesafe_cb(void, void *, (func), (arg)), (arg))
1717

18+
/* Get timer arg. */
19+
void *reltimer_arg(struct oneshot *t);
20+
1821
void timer_expired(tal_t *ctx, struct timer *timer);
1922

2023
#endif /* LIGHTNING_COMMON_TIMEOUT_H */

0 commit comments

Comments
 (0)