More explicit implementation for wantPiece method

This commit is contained in:
Matt Joiner 2013-10-22 18:03:44 +11:00
parent ec0ffa84a4
commit 36b36beb3b
1 changed files with 2 additions and 1 deletions

View File

@ -621,7 +621,8 @@ func (me *Client) peerGotPiece(torrent *Torrent, conn *Connection, piece int) {
}
func (t *Torrent) wantPiece(index int) bool {
return !t.Pieces[index].Complete()
p := t.Pieces[index]
return p.EverHashed && !p.Hashing && len(p.PendingChunkSpecs) != 0
}
func (me *Client) peerUnchoked(torrent *Torrent, conn *Connection) {