Page MenuHomePhabricator

[avalanche] Introduce a datastructure to keep track of peers

Authored by deadalnix on Jun 29 2020, 20:12.



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

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jasonbcox added a subscriber: jasonbcox.

This change seems fine, but there isn't enough info in the summary to get a good picture for why this particular implementation was selected over other possible implementations. Regardless, it appears to do some job and is tested.

Also, there are many typos or grammar issues in the comments, but I won't block on these.

This revision is now accepted and ready to land.Jun 29 2020, 21:51