]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix Client.receiveSkeys
authorMatt Joiner <anacrolix@gmail.com>
Wed, 21 Sep 2016 11:04:52 +0000 (21:04 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 21 Sep 2016 11:04:52 +0000 (21:04 +1000)
Fixes #114. Loop variables in Go are ****ed.

client.go

index a03de770483a33a2b31c3ae8329addd60540a0bd..b0df5fa1da88b67501a50627354500b88dc9f2c5 100644 (file)
--- a/client.go
+++ b/client.go
@@ -826,7 +826,7 @@ func maybeReceiveEncryptedHandshake(rw io.ReadWriter, skeys [][]byte) (ret io.Re
 
 func (cl *Client) receiveSkeys() (ret [][]byte) {
        for ih := range cl.torrents {
-               ret = append(ret, ih[:])
+               ret = append(ret, append([]byte(nil), ih[:]...))
        }
        return
 }