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

Function connectd_req

gossipd/gossipd.c:571–600  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

569
570/*~ connectd's input handler is very simple. */
571static struct io_plan *connectd_req(struct io_conn *conn,
572 const u8 *msg,
573 struct daemon *daemon)
574{
575 enum connectd_gossipd_wire t = fromwire_peektype(msg);
576
577 switch (t) {
578 case WIRE_GOSSIPD_RECV_GOSSIP:
579 handle_recv_gossip(daemon, msg);
580 goto handled;
581
582 case WIRE_GOSSIPD_NEW_PEER:
583 connectd_new_peer(daemon, msg);
584 goto handled;
585
586 case WIRE_GOSSIPD_PEER_GONE:
587 connectd_peer_gone(daemon, msg);
588 goto handled;
589
590 /* We send these, don't receive them. */
591 case WIRE_GOSSIPD_SEND_GOSSIP:
592 break;
593 }
594
595 status_failed(STATUS_FAIL_INTERNAL_ERROR,
596 "Bad msg from connectd2: %s", tal_hex(tmpctx, msg));
597
598handled:
599 return daemon_conn_read_next(conn, daemon->connectd);
600}
601
602/* BOLT #7:
603 *

Callers

nothing calls this directly

Calls 7

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
fromwire_peektypeFunction · 0.50
status_failedFunction · 0.50

Tested by

no test coverage detected