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

Function enable_gossip_stream

gossipd/seeker.c:232–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void enable_gossip_stream(struct seeker *seeker, struct peer *peer,
233 bool ask_for_all)
234{
235 u32 start;
236 u8 *msg;
237
238 /* If we have no gossip, always ask for everything */
239 if (!gossmap_manage_populated(peer->daemon->gm))
240 ask_for_all = true;
241
242 /* Modern timestamp_filter is a trinary: 0 = all, FFFFFFFF = none,
243 * other = from now on */
244 if (ask_for_all) {
245 start = 0;
246 } else {
247 /* Just in case they care */
248 start = clock_time().ts.tv_sec - GOSSIP_SEEKER_INTERVAL(seeker) * 10;
249 }
250
251 status_peer_debug(&peer->id, "seeker: starting gossip (%s)",
252 ask_for_all ? "EVERYTHING" : "streaming");
253
254 /* This is allowed even if they don't understand it (odd) */
255 msg = towire_gossip_timestamp_filter(NULL,
256 &chainparams->genesis_blockhash,
257 start,
258 UINT32_MAX);
259 queue_peer_msg(peer->daemon, &peer->id, take(msg));
260}
261
262static void normal_gossip_start(struct seeker *seeker, struct peer *peer, bool ask_for_all)
263{

Callers 2

normal_gossip_startFunction · 0.85
maybe_rotate_gossipersFunction · 0.85

Calls 3

clock_timeFunction · 0.85
gossmap_manage_populatedFunction · 0.70
queue_peer_msgFunction · 0.70

Tested by

no test coverage detected