client.go | 2 +- connection.go | 2 +- diff --git a/client.go b/client.go index 7ab3a5c436810f4e1bb8ca0433d3963983be624d..322c7e704b138531fab1188465086016247b4254 100644 --- a/client.go +++ b/client.go @@ -1902,7 +1902,7 @@ t.Pieces[i].QueuedForHash = true } go func() { for i := range t.Pieces { - cl.verifyPiece(t, pp.Integer(i)) + cl.verifyPiece(t, i) } }() } diff --git a/connection.go b/connection.go index 8f601d5efb811c20f63666503932361ce3e22845..14c24c85bce03838b36bc3f1acac8b6483997c8e 100644 --- a/connection.go +++ b/connection.go @@ -568,7 +568,7 @@ cn.sentHaves[piece] = true } func (cn *connection) Bitfield(haves []bool) { - if len(cn.sentHaves) != nil { + if cn.sentHaves != nil { panic("bitfield must be first have-related message sent") } cn.Post(pp.Message{