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

Function gossip_msg

lightningd/gossip_control.c:189–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189static 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
231static void gossipd_new_blockheight_reply(struct subd *gossipd,
232 const u8 *reply,

Callers

nothing calls this directly

Calls 7

fromwire_peektypeFunction · 0.85
handle_init_cupdateFunction · 0.85
handle_init_nannounceFunction · 0.85
get_txoutFunction · 0.85
handle_peer_update_dataFunction · 0.85
tal_freeFunction · 0.85
handle_connect_to_peerFunction · 0.85

Tested by

no test coverage detected