Page MenuHomePhabricator

[avalanche] Introduce a datastructure to keep track of peers
ClosedPublic

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

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
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