We get this when we have a new peer. */
| 895 | |
| 896 | /* We get this when we have a new peer. */ |
| 897 | void seeker_setup_peer_gossip(struct seeker *seeker, struct peer *peer) |
| 898 | { |
| 899 | /* Can't do anything useful with these peers. */ |
| 900 | if (!peer->gossip_queries_feature) |
| 901 | return; |
| 902 | |
| 903 | /* Don't start gossiping until we're synced. */ |
| 904 | if (seeker->daemon->current_blockheight == 0) |
| 905 | return; |
| 906 | |
| 907 | switch (seeker->state) { |
| 908 | case STARTING_UP: |
| 909 | if (seeker->random_peer_softref == NULL) |
| 910 | peer_gossip_startup(seeker, peer); |
| 911 | /* Waiting for seeker_check to release us */ |
| 912 | return; |
| 913 | |
| 914 | /* In these states, we set up peers to stream gossip normally */ |
| 915 | case PROBING_SCIDS: |
| 916 | case PROBING_NANNOUNCES: |
| 917 | case NORMAL: |
| 918 | case ASKING_FOR_UNKNOWN_SCIDS: |
| 919 | case ASKING_FOR_STALE_SCIDS: |
| 920 | normal_gossip_start(seeker, peer); |
| 921 | return; |
| 922 | } |
| 923 | abort(); |
| 924 | } |
| 925 | |
| 926 | bool remove_unknown_scid(struct seeker *seeker, |
| 927 | const struct short_channel_id *scid, |
no test coverage detected