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

Function conn_in

connectd/connectd.c:435–454  ·  view source on GitHub ↗

~ Once we've got a connection in, we set it up here (whether it's via the * websocket proxy, or direct). */

Source from the content-addressed store, hash-verified

433/*~ Once we've got a connection in, we set it up here (whether it's via the
434 * websocket proxy, or direct). */
435static struct io_plan *conn_in(struct io_conn *conn,
436 struct conn_in *conn_in_arg)
437{
438 struct daemon *daemon = conn_in_arg->daemon;
439 struct oneshot *timeout;
440
441 /* If they don't complete handshake in reasonable time, we hang up */
442 timeout = new_reltimer(&daemon->timers, conn,
443 time_from_sec(daemon->timeout_secs),
444 conn_timeout, conn);
445
446 /*~ The crypto handshake differs depending on whether you received or
447 * initiated the socket connection, so there are two entry points.
448 * Note, again, the notleak() to avoid our simplistic leak detection
449 * code from thinking `conn` (which we don't keep a pointer to) is
450 * leaked */
451 return responder_handshake(notleak(conn), &daemon->mykey,
452 &conn_in_arg->addr, timeout,
453 handshake_in_success, daemon);
454}
455
456/*~ When we get a direct connection in we set up its network address
457 * then call handshake.c to set up the crypto state. */

Callers 1

connection_inFunction · 0.70

Calls 1

time_from_secFunction · 0.85

Tested by

no test coverage detected