erlang-libp2p icon indicating copy to clipboard operation
erlang-libp2p copied to clipboard

Possibly skipping first peer when randomly selecting

Open antonyscerri opened this issue 2 years ago • 0 comments

Hi

New to erlang so excuse me if I have misinterpreted this.

This line and the subsequent few look like it may be skipping the first peer in the list (when there is more than one).

https://github.com/helium/erlang-libp2p/blob/master/src/peerbook/libp2p_peerbook.erl#L229

If uniform picks from 1 to N inclusive and is then added to the start position it means it can never begin with that initial point.

Thanks

Tony

antonyscerri avatar May 13 '22 01:05 antonyscerri