| 146 | } |
| 147 | |
| 148 | struct seeker *new_seeker(struct daemon *daemon) |
| 149 | { |
| 150 | struct seeker *seeker = tal(daemon, struct seeker); |
| 151 | |
| 152 | seeker->daemon = daemon; |
| 153 | uintmap_init(&seeker->unknown_scids); |
| 154 | seeker->num_unknown_scids = 0; |
| 155 | uintmap_init(&seeker->stale_scids); |
| 156 | seeker->random_peer = NULL; |
| 157 | u32 gossipers = daemon->autoconnect_seeker_peers > SEEKER_GOSSIPERS ? |
| 158 | daemon->autoconnect_seeker_peers : SEEKER_GOSSIPERS; |
| 159 | seeker->gossiper = tal_arrz(seeker, struct peer *, gossipers); |
| 160 | seeker->preferred_peer = NULL; |
| 161 | seeker->unknown_nodes = false; |
| 162 | seeker->last_full_sync_peer = NULL; |
| 163 | seeker->new_gossiper_elapsed = 0; |
| 164 | set_state(seeker, STARTING_UP, NULL, "New seeker"); |
| 165 | begin_check_timer(seeker); |
| 166 | seeker->sync_timer = NULL; |
| 167 | return seeker; |
| 168 | } |
| 169 | |
| 170 | static void set_preferred_peer(struct seeker *seeker, struct peer *peer) |
| 171 | { |
no test coverage detected