HomePhabricator

[avalanche] Only select from peers which have an actual node attached

Description

[avalanche] Only select from peers which have an actual node attached

Summary:
This doesn't change the behavior to the extent that selecting a peer with no node would trigger another selection round, but this wasteful.

Instead, we maintain the node count attached to the peer and act accordingly.

Depends on D8606

Test Plan:
Addd code in PeerManager::verify to check that the node count is tracked properly.
Existing tests ensure that the observable behavior is not altered in any way that matters.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8610

Details

Provenance
deadalnixAuthored on Dec 5 2020, 23:39
deadalnixPushed on Dec 7 2020, 17:59
Reviewer
Restricted Project
Differential Revision
D8610: [avalanche] Only select from peers which have an actual node attached
Parents
rABCfa390b74b8f0: [avalanche] Refactor the PeerManager
Branches
Unknown
Tags
Unknown