]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Trivial fix for one of the last commits
authorMatt Joiner <anacrolix@gmail.com>
Thu, 26 Jun 2014 08:08:14 +0000 (18:08 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 26 Jun 2014 08:08:14 +0000 (18:08 +1000)
client.go

index 08e1341608470940c0bd951c9f66267d683edf1d..4888984353d2424febdd8fafd9995ec599ec5786 100644 (file)
--- a/client.go
+++ b/client.go
@@ -463,7 +463,7 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error {
                                err = errors.New("received unexpected bitfield")
                                break
                        }
-                       c.PeerPieces = msg.Bitfield[:len(t.NumPieces())]
+                       c.PeerPieces = msg.Bitfield[:t.NumPieces()]
                        for index, has := range c.PeerPieces {
                                if has {
                                        me.peerGotPiece(t, c, index)