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

Function handle_channel_update_msg

gossipd/gossipd.c:251–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251static u8 *handle_channel_update_msg(struct peer *peer, const u8 *msg)
252{
253 struct short_channel_id unknown_scid;
254 /* Hand the channel_update to the routing code */
255 u8 *err;
256
257 unknown_scid.u64 = 0;
258 err = handle_channel_update(peer->daemon->rstate, msg, peer,
259 &unknown_scid, false);
260 if (err)
261 return err;
262
263 /* If it's an unknown channel, ask someone about it */
264 if (unknown_scid.u64 != 0)
265 query_unknown_channel(peer->daemon, peer, &unknown_scid);
266
267 /*~ As a nasty compromise in the spec, we only forward `channel_announce`
268 * once we have a `channel_update`; the channel isn't *usable* for
269 * routing until you have both anyway. For this reason, we might have
270 * just sent out our own channel_announce, so we check if it's time to
271 * send a node_announcement too. */
272 maybe_send_own_node_announce(peer->daemon, false);
273 return NULL;
274}
275
276static u8 *handle_node_announce(struct peer *peer, const u8 *msg)
277{

Callers 1

handle_recv_gossipFunction · 0.85

Calls 3

query_unknown_channelFunction · 0.85
handle_channel_updateFunction · 0.70

Tested by

no test coverage detected