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

Function connection_out

connectd/connectd.c:849–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

847}
848
849struct io_plan *connection_out(struct io_conn *conn, struct connecting *connect)
850{
851 struct pubkey outkey;
852 struct oneshot *timeout;
853
854 /* This shouldn't happen: lightningd should not give invalid ids! */
855 if (!pubkey_from_node_id(&outkey, &connect->id)) {
856 status_broken("Connection out to invalid id %s",
857 fmt_node_id(tmpctx, &connect->id));
858 return io_close(conn);
859 }
860
861 /* If they don't complete handshake in reasonable time, hang up */
862 timeout = new_reltimer(&connect->daemon->timers, conn,
863 time_from_sec(connect->daemon->timeout_secs),
864 conn_timeout, conn);
865 status_peer_debug(&connect->id, "Connected out, starting crypto");
866
867 connect->connstate = "Cryptographic handshake";
868 return initiator_handshake(conn, &connect->daemon->mykey, &outkey,
869 &connect->addrs[connect->addrnum],
870 timeout, NORMAL_SOCKET, handshake_out_success, connect);
871}
872
873/*~ When we've exhausted all addresses without success, we come here.
874 *

Callers 2

connect_finish2Function · 0.85
connect_finishFunction · 0.85

Calls 4

fmt_node_idFunction · 0.85
io_closeFunction · 0.85
time_from_secFunction · 0.85
pubkey_from_node_idFunction · 0.50

Tested by

no test coverage detected