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

Function recv_gossip

connectd/connectd.c:2481–2498  ·  view source on GitHub ↗

~ gossipd sends us gossip to send to the peers. */

Source from the content-addressed store, hash-verified

2479
2480/*~ gossipd sends us gossip to send to the peers. */
2481static struct io_plan *recv_gossip(struct io_conn *conn,
2482 const u8 *msg,
2483 struct daemon *daemon)
2484{
2485 struct node_id dst;
2486 u8 *gossip_msg;
2487 struct peer *peer;
2488
2489 if (!fromwire_gossipd_send_gossip(msg, msg, &dst, &gossip_msg))
2490 status_failed(STATUS_FAIL_GOSSIP_IO, "Unknown msg %i",
2491 fromwire_peektype(msg));
2492
2493 peer = peer_htable_get(daemon->peers, &dst);
2494 if (peer)
2495 inject_peer_msg(peer, take(gossip_msg));
2496
2497 return daemon_conn_read_next(conn, daemon->gossipd);
2498}
2499
2500static void gossipd_failed(struct daemon_conn *gossipd)
2501{

Callers

nothing calls this directly

Calls 4

fromwire_peektypeFunction · 0.85
daemon_conn_read_nextFunction · 0.85
inject_peer_msgFunction · 0.70
status_failedFunction · 0.50

Tested by

no test coverage detected