import * as proxyAddr from 'proxy-addr'
import { Server as WebSocketServer } from 'ws'
import { CONFIG, TRACKER_RATE_LIMITS } from '../initializers/constants'
+import { VideoFileModel } from '../models/video/video-file'
const TrackerServer = bitTorrentTracker.Server
return cb(new Error(`Too many requests (${peersIpInfoHash[ key ]} of ip ${ip} for torrent ${infoHash}`))
}
- return cb()
+ VideoFileModel.isInfohashExists(infoHash)
+ .then(exists => {
+ if (exists === false) return cb(new Error(`Unknown infoHash ${infoHash}`))
+
+ return cb()
+ })
}
})