waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

chore: `numPeers` in `BaseProtocol.getPeers()` should not take 0 for all peers #2055

Open danisharora099 opened 1 week ago

danisharora099 commented 1 week ago

This is a change request

Problem

https://github.com/waku-org/js-waku/blob/4db508b962736426f4897995a2b525c82fe0ba37/packages/core/src/lib/base_protocol.ts#L79 numPeers takes in 0 as the value if all peers are to be returned. This is unintuitive to correlate 0 with all peers

Proposed Solutions

Using Infinity instead of 0 would be more intuitive

Notes