Fantom-foundation / lachesis-rs

Lachesis BFT consensus for permission-less networks, in Rust
MIT License
34 stars 5 forks source link

Create a network object implementing `IteratorRandom` #29

Open AgustinCB opened 5 years ago

AgustinCB commented 5 years ago

Instead of having a HashMap<PeerId, Peer> in every consensus protocol with methods to choose peers randomly, lets create a Network structure with that map, that implements the trait IteratorRandom and use that everywhere.