~ gossipd sends us gossip to send to the peers. */
| 1981 | |
| 1982 | /*~ gossipd sends us gossip to send to the peers. */ |
| 1983 | static struct io_plan *recv_gossip(struct io_conn *conn, |
| 1984 | const u8 *msg, |
| 1985 | struct daemon *daemon) |
| 1986 | { |
| 1987 | struct node_id dst; |
| 1988 | u8 *gossip_msg; |
| 1989 | struct peer *peer; |
| 1990 | |
| 1991 | if (!fromwire_gossipd_send_gossip(msg, msg, &dst, &gossip_msg)) |
| 1992 | status_failed(STATUS_FAIL_GOSSIP_IO, "Unknown msg %i", |
| 1993 | fromwire_peektype(msg)); |
| 1994 | |
| 1995 | peer = peer_htable_get(&daemon->peers, &dst); |
| 1996 | if (peer) |
| 1997 | inject_peer_msg(peer, take(gossip_msg)); |
| 1998 | |
| 1999 | return daemon_conn_read_next(conn, daemon->gossipd); |
| 2000 | } |
| 2001 | |
| 2002 | /*~ This is a hook used by the memleak code (if DEVELOPER=1): it can't see |
| 2003 | * pointers inside hash tables, so we give it a hint here. */ |
nothing calls this directly
no test coverage detected