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

Function connectd_req

gossipd/gossipd.c:289–318  ·  view source on GitHub ↗

~ connectd's input handler is very simple. */

Source from the content-addressed store, hash-verified

287
288/*~ connectd's input handler is very simple. */
289static struct io_plan *connectd_req(struct io_conn *conn,
290 const u8 *msg,
291 struct daemon *daemon)
292{
293 enum connectd_gossipd_wire t = fromwire_peektype(msg);
294
295 switch (t) {
296 case WIRE_GOSSIPD_RECV_GOSSIP:
297 handle_recv_gossip(daemon, msg);
298 goto handled;
299
300 case WIRE_GOSSIPD_NEW_PEER:
301 connectd_new_peer(daemon, msg);
302 goto handled;
303
304 case WIRE_GOSSIPD_PEER_GONE:
305 connectd_peer_gone(daemon, msg);
306 goto handled;
307
308 /* We send these, don't receive them. */
309 case WIRE_GOSSIPD_SEND_GOSSIP:
310 break;
311 }
312
313 status_failed(STATUS_FAIL_INTERNAL_ERROR,
314 "Bad msg from connectd2: %s", tal_hex(tmpctx, msg));
315
316handled:
317 return daemon_conn_read_next(conn, daemon->connectd);
318}
319
320void tell_lightningd_peer_update(struct daemon *daemon,
321 const struct node_id *source_peer,

Callers

nothing calls this directly

Calls 7

fromwire_peektypeFunction · 0.85
handle_recv_gossipFunction · 0.85
connectd_new_peerFunction · 0.85
connectd_peer_goneFunction · 0.85
tal_hexFunction · 0.85
daemon_conn_read_nextFunction · 0.85
status_failedFunction · 0.50

Tested by

no test coverage detected