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

Function maybe_free_peer

connectd/multiplex.c:86–94  ·  view source on GitHub ↗

Except for a reconnection, we finally free a peer when the io_conn * is closed and all subds are gone. */

Source from the content-addressed store, hash-verified

84/* Except for a reconnection, we finally free a peer when the io_conn
85 * is closed and all subds are gone. */
86static void maybe_free_peer(struct peer *peer)
87{
88 if (peer->to_peer)
89 return;
90 if (tal_count(peer->subds) != 0)
91 return;
92 status_debug("maybe_free_peer freeing peer!");
93 tal_free(peer);
94}
95
96/* We try to send the final messages, but if buffer is full and they're
97 * not reading, we have to give up. */

Callers 2

destroy_subdFunction · 0.85
destroy_peer_connFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected