fix: add panic recovery to auto-scan, cap DHT nodes at 200

This commit is contained in:
Deivid Soto 2026-03-29 20:32:08 +02:00
parent c476bd865c
commit 3badde606e
2 changed files with 10 additions and 0 deletions

View file

@ -642,6 +642,11 @@ func saveDhtNodesBinary(client *torrent.Client) {
return
}
// Cap at 200 nodes to prevent unbounded file growth
if len(allNodes) > 200 {
allNodes = allNodes[:200]
}
path := dhtNodesBinPath()
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
return