Don't consider a peer to have touched a piece if a chunk isn't written successfully
This prevents peers being banned when there are issues with the data service locally.
This commit is contained in:
parent
8c37ff73af
commit
672e3c4136
|
@ -2584,12 +2584,13 @@ func (me *Client) downloadedChunk(t *torrent, c *connection, msg *pp.Message) er
|
|||
return
|
||||
}
|
||||
tr.Stop("write chunk")
|
||||
}()
|
||||
// This could be made dependent on whether any actual data was written.
|
||||
me.mu.Lock()
|
||||
if c.peerTouchedPieces == nil {
|
||||
c.peerTouchedPieces = make(map[int]struct{})
|
||||
}
|
||||
c.peerTouchedPieces[int(req.Index)] = struct{}{}
|
||||
me.mu.Unlock()
|
||||
}()
|
||||
|
||||
// log.Println("got chunk", req)
|
||||
me.event.Broadcast()
|
||||
|
|
Loading…
Reference in New Issue