| 187 | } |
| 188 | |
| 189 | static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds) |
| 190 | { |
| 191 | enum gossipd_wire t = fromwire_peektype(msg); |
| 192 | |
| 193 | switch (t) { |
| 194 | /* These are messages we send, not them. */ |
| 195 | case WIRE_GOSSIPD_INIT: |
| 196 | case WIRE_GOSSIPD_GET_TXOUT_REPLY: |
| 197 | case WIRE_GOSSIPD_OUTPOINTS_SPENT: |
| 198 | case WIRE_GOSSIPD_DEV_MEMLEAK: |
| 199 | case WIRE_GOSSIPD_DEV_COMPACT_STORE: |
| 200 | case WIRE_GOSSIPD_NEW_BLOCKHEIGHT: |
| 201 | case WIRE_GOSSIPD_ADDGOSSIP: |
| 202 | /* This is a reply, so never gets through to here. */ |
| 203 | case WIRE_GOSSIPD_INIT_REPLY: |
| 204 | case WIRE_GOSSIPD_DEV_MEMLEAK_REPLY: |
| 205 | case WIRE_GOSSIPD_DEV_COMPACT_STORE_REPLY: |
| 206 | case WIRE_GOSSIPD_ADDGOSSIP_REPLY: |
| 207 | case WIRE_GOSSIPD_NEW_BLOCKHEIGHT_REPLY: |
| 208 | break; |
| 209 | |
| 210 | case WIRE_GOSSIPD_INIT_CUPDATE: |
| 211 | handle_init_cupdate(gossip->ld, msg); |
| 212 | break; |
| 213 | case WIRE_GOSSIPD_INIT_NANNOUNCE: |
| 214 | handle_init_nannounce(gossip->ld, msg); |
| 215 | break; |
| 216 | case WIRE_GOSSIPD_GET_TXOUT: |
| 217 | get_txout(gossip, msg); |
| 218 | break; |
| 219 | case WIRE_GOSSIPD_REMOTE_CHANNEL_UPDATE: |
| 220 | /* Please stash in database for us! */ |
| 221 | handle_peer_update_data(gossip->ld, msg); |
| 222 | tal_free(msg); |
| 223 | break; |
| 224 | case WIRE_GOSSIPD_CONNECT_TO_PEER: |
| 225 | /* Please try connecting to this peer for more gossip. */ |
| 226 | handle_connect_to_peer(gossip, msg); |
| 227 | } |
| 228 | return 0; |
| 229 | } |
| 230 | |
| 231 | static void gossipd_new_blockheight_reply(struct subd *gossipd, |
| 232 | const u8 *reply, |
nothing calls this directly
no test coverage detected