Merge pull request #153 from mrd0ll4r/middleware-smallfix

hotfix: initialized scrape map
This commit is contained in:
Jimmy Zelinskie
2016-04-02 20:31:40 -04:00
5 changed files with 9 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ func responseScrapeClient(next tracker.ScrapeHandler) tracker.ScrapeHandler {
return func(cfg *chihaya.TrackerConfig, req *chihaya.ScrapeRequest, resp *chihaya.ScrapeResponse) (err error) {
storage := store.MustGetStore()
for _, infoHash := range req.InfoHashes {
resp.Files[string(infoHash)] = chihaya.Scrape{
resp.Files[infoHash] = chihaya.Scrape{
Complete: int32(storage.NumSeeders(infoHash)),
Incomplete: int32(storage.NumLeechers(infoHash)),
}