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

Function local_enable_chan

gossipd/gossip_generation.c:921–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

919}
920
921void local_enable_chan(struct daemon *daemon, const struct chan *chan, int direction)
922{
923 struct deferred_update *du;
924 u8 *update = prev_update(tmpctx, daemon, chan, direction);
925
926
927 if (!update)
928 return;
929
930 du = find_deferred_update(daemon, chan);
931
932 /* Will a deferred update enable it? If so, apply immediately. */
933 if (du && is_enabled(du->update)) {
934 apply_deferred_update(du);
935 return;
936 }
937
938 /* OK, we definitely don't want deferred update to disable! */
939 tal_free(du);
940
941 /* Is it already enabled? */
942 if (is_enabled(update))
943 return;
944
945 /* Apply this enabling update immediately. */
946 set_disable_flag(update, false);
947 sign_timestamp_and_apply_update(daemon, chan, direction, take(update));
948}

Callers 1

peer_enable_channelsFunction · 0.85

Calls 7

prev_updateFunction · 0.85
find_deferred_updateFunction · 0.85
is_enabledFunction · 0.85
apply_deferred_updateFunction · 0.85
tal_freeFunction · 0.85
set_disable_flagFunction · 0.85

Tested by

no test coverage detected