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

Function prev_update

gossipd/gossip_generation.c:698–714  ·  view source on GitHub ↗

Get previous update. */

Source from the content-addressed store, hash-verified

696
697/* Get previous update. */
698static u8 *prev_update(const tal_t *ctx,
699 struct daemon *daemon, const struct chan *chan, int direction)
700{
701 u8 *prev;
702
703 if (!is_halfchan_defined(&chan->half[direction]))
704 return NULL;
705
706 prev = cast_const(u8 *,
707 gossip_store_get(tmpctx, daemon->rstate->gs,
708 chan->half[direction].bcast.index));
709
710 /* If it's a private update, unwrap */
711 if (!fromwire_gossip_store_private_update(ctx, prev, &prev))
712 tal_steal(ctx, prev);
713 return prev;
714}
715
716/* This is a refresh of a local channel (after 13 days). */
717void refresh_local_channel(struct daemon *daemon,

Callers 3

refresh_local_channelFunction · 0.85
local_disable_chanFunction · 0.85
local_enable_chanFunction · 0.85

Calls 2

is_halfchan_definedFunction · 0.85
gossip_store_getFunction · 0.70

Tested by

no test coverage detected