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

Function connect_to_peer

connectd/connectd.c:1802–1813  ·  view source on GitHub ↗

lightningd tells us to connect to a peer by id, with optional addr hint. */

Source from the content-addressed store, hash-verified

1800
1801/* lightningd tells us to connect to a peer by id, with optional addr hint. */
1802static void connect_to_peer(struct daemon *daemon, const u8 *msg)
1803{
1804 struct node_id id;
1805 struct wireaddr_internal *addrhint;
1806 struct wireaddr *addrs;
1807
1808 if (!fromwire_connectd_connect_to_peer(tmpctx, msg,
1809 &id, &addrs, &addrhint))
1810 master_badmsg(WIRE_CONNECTD_CONNECT_TO_PEER, msg);
1811
1812 try_connect_peer(daemon, &id, addrs, addrhint);
1813}
1814
1815/* lightningd tells us a peer should be disconnected. */
1816static void peer_discard(struct daemon *daemon, const u8 *msg)

Callers 1

recv_reqFunction · 0.85

Calls 2

try_connect_peerFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected