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

Function destroy_peer_immediately

connectd/multiplex.c:1653–1664  ·  view source on GitHub ↗

When peer reconnects, we close the old connection unceremoniously. */

Source from the content-addressed store, hash-verified

1651
1652/* When peer reconnects, we close the old connection unceremoniously. */
1653void destroy_peer_immediately(struct peer *peer)
1654{
1655 /* Forgo normal destructors which involve timeouts */
1656 if (peer->to_peer)
1657 tal_del_destructor2(peer->to_peer, destroy_peer_conn, peer);
1658
1659 for (size_t i = 0; i < tal_count(peer->subds); i++) {
1660 if (peer->subds[i]->conn)
1661 tal_del_destructor(peer->subds[i], destroy_connected_subd);
1662 }
1663 tal_free(peer);
1664}
1665
1666struct io_plan *multiplex_peer_setup(struct io_conn *peer_conn,
1667 struct peer *peer)

Callers 1

peer_connectedFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected