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

Function node_has_broadcastable_channels

gossipd/routing.c:406–419  ·  view source on GitHub ↗

We can *send* a channel_announce for a channel attached to this node: * we only send once we have a channel_update. */

Source from the content-addressed store, hash-verified

404/* We can *send* a channel_announce for a channel attached to this node:
405 * we only send once we have a channel_update. */
406static bool node_has_broadcastable_channels(struct node *node)
407{
408 struct chan_map_iter i;
409 struct chan *c;
410
411 for (c = first_chan(node, &i); c; c = next_chan(node, &i)) {
412 if (!is_chan_public(c))
413 continue;
414 if (is_halfchan_defined(&c->half[0])
415 || is_halfchan_defined(&c->half[1]))
416 return true;
417 }
418 return false;
419}
420
421static bool node_announce_predates_channels(const struct node *node)
422{

Callers 2

remove_chan_from_nodeFunction · 0.85

Calls 4

first_chanFunction · 0.85
next_chanFunction · 0.85
is_chan_publicFunction · 0.85
is_halfchan_definedFunction · 0.85

Tested by

no test coverage detected