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

Function destroy_peer

gossipd/gossipd.c:82–93  ·  view source on GitHub ↗

~ Destroy a peer, usually because the per-peer daemon has exited. * * Were you wondering why we call this "destroy_peer" and not "peer_destroy"? * I thought not! But while CCAN modules are required to keep to their own * prefix namespace, leading to unnatural word order, we couldn't stomach that * for our own internal use. We use 'find_foo', 'destroy_foo' and 'new_foo'. */

Source from the content-addressed store, hash-verified

80 * for our own internal use. We use 'find_foo', 'destroy_foo' and 'new_foo'.
81 */
82static void destroy_peer(struct peer *peer)
83{
84 struct node *node;
85
86 /* Remove it from the peers list */
87 list_del_from(&peer->daemon->peers, &peer->list);
88
89 /* If we have a channel with this peer, disable it. */
90 node = get_node(peer->daemon->rstate, &peer->id);
91 if (node)
92 peer_disable_channels(peer->daemon, node);
93}
94
95/* Search for a peer. */
96struct peer *find_peer(struct daemon *daemon, const struct node_id *id)

Callers

nothing calls this directly

Calls 3

list_del_fromFunction · 0.85
peer_disable_channelsFunction · 0.85
get_nodeFunction · 0.70

Tested by

no test coverage detected