Merge pull request #2049 from PR0M3TH3AN/codex/update-timeoutid-handler-in-probepeers

Use webseed-aware peer counts for probePeers timeout
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-01 12:20:20 -05:00
commit c646d7355c
1 file changed
+3 -2
+3 -2
View File
@@ -415,8 +415,9 @@ export class TorrentClient {
if (safeTimeout > 0) {
timeoutId = setTimeout(() => {
const peers = Math.max(0, Math.floor(normalizeNumber(torrent?.numPeers, 0)));
const webseedOnly = peers === 0 && hasWebSeed;
const counts = getPeerCounts();
const peers = Math.max(0, counts.totalPeers);
const webseedOnly = counts.regularPeers === 0 && counts.webSeeds > 0;
if (typeof process !== "undefined" && process.env.NODE_ENV === "test" && !webseedOnly && hasWebSeed) {
console.log(`[probePeers:timeout] logic check: peers=${peers} hasWebSeed=${hasWebSeed} webseedOnly=${webseedOnly}`);
}