dmotz / trystero

✨🤝✨ Build instant multiplayer webapps, no server required — Magic WebRTC matchmaking over BitTorrent, Nostr, MQTT, IPFS, Supabase, and Firebase
https://oxism.com/trystero
MIT License
1.33k stars 92 forks source link

[Question] `trackerRedundancy` maximum of 3 #41

Closed jeremyckahn closed 1 year ago

jeremyckahn commented 1 year ago

Hi, per the documentation for trackerRedundancy:

Integer specifying how many torrent trackers to connect to simultaneously in case some fail. Defaults to 2, maximum of 3.

However, I'm not seeing this maximum limit reflected in the code. Here's the only place in the code where trackerRedundancy seems to be read: https://github.com/dmotz/trystero/blob/1602156746f8f1009e67f4c2fd9e8b192b29bce0/src/torrent.js#L39-L44

Is the maximum of 3 enforced in some less obvious way? If not, is there any reason one couldn't set trackerRedundancy to a higher number?

dmotz commented 1 year ago

Thanks for catching that! At one point the torrent module only specified 3 default trackers, which is why the docs made mention of it. In any case, that info is now outdated and irrelevant anyway since there's no effect in passing a larger number than the length of the current tracker list. I've removed it from the docs.

jeremyckahn commented 1 year ago

That makes sense. Thanks for the context and for updating @dmotz!