| 350 | } |
| 351 | |
| 352 | struct peer *next_random_peer(struct daemon *daemon, |
| 353 | const struct peer *first, |
| 354 | struct peer_node_id_map_iter *it) |
| 355 | { |
| 356 | struct peer *p; |
| 357 | |
| 358 | p = peer_node_id_map_next(daemon->peers, it); |
| 359 | if (!p) |
| 360 | p = peer_node_id_map_first(daemon->peers, it); |
| 361 | |
| 362 | /* Full circle? */ |
| 363 | if (p == first) |
| 364 | return NULL; |
| 365 | return p; |
| 366 | } |
| 367 | |
| 368 | /* This is called when lightningd or connectd closes its connection to |
| 369 | * us. We simply exit. */ |
no outgoing calls
no test coverage detected