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

Function defer_update

gossipd/gossip_generation.c:654–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652}
653
654static void defer_update(struct daemon *daemon,
655 u32 delay,
656 const struct chan *chan,
657 int direction,
658 u8 *unsigned_update TAKES)
659{
660 struct deferred_update *du;
661
662 /* Override any existing one */
663 tal_free(find_deferred_update(daemon, chan));
664
665 /* If chan is gone, so are we. */
666 du = tal(chan, struct deferred_update);
667 du->daemon = daemon;
668 du->chan = chan;
669 du->direction = direction;
670 du->update = sign_and_timestamp_update(du, daemon, chan, direction,
671 unsigned_update);
672 if (delay != 0xFFFFFFFF)
673 du->channel_update_timer = new_reltimer(&daemon->timers, du,
674 time_from_sec(delay),
675 apply_deferred_update,
676 du);
677 else
678 du->channel_update_timer = NULL;
679 list_add_tail(&daemon->deferred_updates, &du->list);
680 tal_add_destructor(du, destroy_deferred_update);
681}
682
683/* If there is a pending update for this local channel, apply immediately. */
684static bool local_channel_update_latest(struct daemon *daemon, struct chan *chan)

Callers 2

local_disable_chanFunction · 0.85

Calls 4

tal_freeFunction · 0.85
find_deferred_updateFunction · 0.85
time_from_secFunction · 0.85

Tested by

no test coverage detected