-
Notifications
You must be signed in to change notification settings - Fork 457
Implement maximum number of inbound peer connections - Closes #3720 #3779
Implement maximum number of inbound peer connections - Closes #3720 #3779
Conversation
b258733
to
fc87ab3
Compare
Verify if the maximum number of inbound peer connections is respected in a sufficiently large sample.
fc87ab3
to
fbc941d
Compare
f38d731
to
a57d70e
Compare
faa80c6
to
373faf8
Compare
public getAllPeers(): ReadonlyArray<Peer> { | ||
return [...this._peerMap.values()]; | ||
public getAllPeers( | ||
kind?: typeof OutboundPeer | typeof InboundPeer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a string enum 'outbound' or 'inbound' for consistency. Also this is confusing because in JavaScript typeof OutboundPeer
would evaluate to 'function'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the conclusion about this one? Although in tyepescript, this seems to be valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have no better option and it is valid Typescript-wise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this method is only used internally by the PeerPool and not exposed outside the P2P library, I was convinced that it's OK in this case.
How to test it?
npm run test:integration
Review checklist