How much is peer worth (when considering disconnect)? */
| 569 | |
| 570 | /* How much is peer worth (when considering disconnect)? */ |
| 571 | static size_t peer_score(struct daemon *daemon, |
| 572 | const struct node_id *id, |
| 573 | struct subd **subds) |
| 574 | { |
| 575 | #define PEER_SCORE_MAX 2 |
| 576 | /* Explicitly important! */ |
| 577 | if (important_id_htable_get(daemon->important_ids, id)) |
| 578 | return 2; |
| 579 | /* Otherwise, prefer ones which aren't talking. */ |
| 580 | if (tal_count(subds)) |
| 581 | return 1; |
| 582 | return 0; |
| 583 | } |
| 584 | |
| 585 | /*~ When file descriptors are exhausted, we might be better to try to |
| 586 | * free an existing connection, rather than ignoring new ones. */ |
no outgoing calls
no test coverage detected