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

Function connection_out

connectd/connectd.c:793–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

791}
792
793struct io_plan *connection_out(struct io_conn *conn, struct connecting *connect)
794{
795 struct pubkey outkey;
796 struct oneshot *timeout;
797
798 /* This shouldn't happen: lightningd should not give invalid ids! */
799 if (!pubkey_from_node_id(&outkey, &connect->id)) {
800 status_broken("Connection out to invalid id %s",
801 fmt_node_id(tmpctx, &connect->id));
802 return io_close(conn);
803 }
804
805 /* If they don't complete handshake in reasonable time, hang up */
806 timeout = new_reltimer(&connect->daemon->timers, conn,
807 time_from_sec(connect->daemon->timeout_secs),
808 conn_timeout, conn);
809 status_peer_debug(&connect->id, "Connected out, starting crypto");
810
811 connect->connstate = "Cryptographic handshake";
812 return initiator_handshake(conn, &connect->daemon->mykey, &outkey,
813 &connect->addrs[connect->addrnum],
814 timeout, NORMAL_SOCKET, handshake_out_success, connect);
815}
816
817/*~ When we've exhausted all addresses without success, we come here.
818 *

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