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

Function multiplex_peer_setup

connectd/multiplex.c:1215–1232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1213}
1214
1215struct io_plan *multiplex_peer_setup(struct io_conn *peer_conn,
1216 struct peer *peer)
1217{
1218 /*~ If conn closes, we drain the subd connections and wait for
1219 * lightningd to tell us to close with the peer */
1220 tal_add_destructor2(peer_conn, destroy_peer_conn, peer);
1221
1222 /* Start keepalives */
1223 peer->expecting_pong = PONG_UNEXPECTED;
1224 set_ping_timer(peer);
1225
1226 /* This used to be in openingd; don't break tests. */
1227 status_peer_debug(&peer->id, "Handed peer, entering loop");
1228
1229 return io_duplex(peer_conn,
1230 read_hdr_from_peer(peer_conn, peer),
1231 write_to_peer(peer_conn, peer));
1232}
1233
1234void peer_connect_subd(struct daemon *daemon, const u8 *msg, int fd)
1235{

Callers 1

peer_connectedFunction · 0.85

Calls 4

set_ping_timerFunction · 0.85
io_duplexFunction · 0.85
read_hdr_from_peerFunction · 0.85
write_to_peerFunction · 0.85

Tested by

no test coverage detected