HomePhabricator

[avalanche] Introduce a datastructure to keep track of peers

Description

[avalanche] Introduce a datastructure to keep track of peers

Summary:
This implement an utility that can select a peer with a probability depending on its score. The higher the score, the more likely that peer is to be chosen.

Obviously, this is not usable as this because it exposes index from internal datastructures, but this much allows to check the algorithm are correct and constitue a useful unit of work.

Test Plan:

ninja all check-avalanche

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

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

Details

Provenance
deadalnixAuthored on Jun 27 2020, 21:50
deadalnixPushed on Jun 29 2020, 22:49
Reviewer
Restricted Project
Differential Revision
D6772: [avalanche] Introduce a datastructure to keep track of peers
Parents
rABCeb48537aa444: Merge #14543: [QA] minor p2p_sendheaders fix of height in coinbase
Branches
Unknown
Tags
Unknown