| 230 | } |
| 231 | |
| 232 | static 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 | |
| 262 | static void normal_gossip_start(struct seeker *seeker, struct peer *peer, bool ask_for_all) |
| 263 | { |
no test coverage detected