How much is peer worth (when considering disconnect)? */
| 604 | |
| 605 | /* How much is peer worth (when considering disconnect)? */ |
| 606 | static size_t peer_score(struct daemon *daemon, |
| 607 | const struct node_id *id, |
| 608 | struct subd **subds) |
| 609 | { |
| 610 | #define PEER_SCORE_MAX 2 |
| 611 | /* Explicitly important! */ |
| 612 | if (important_id_htable_get(daemon->important_ids, id)) |
| 613 | return 2; |
| 614 | /* Otherwise, prefer ones which aren't talking. */ |
| 615 | if (tal_count(subds)) |
| 616 | return 1; |
| 617 | return 0; |
| 618 | } |
| 619 | |
| 620 | /*~ When file descriptors are exhausted, we might be better to try to |
| 621 | * free an existing connection, rather than ignoring new ones. */ |
no outgoing calls
no test coverage detected