Don't return error while converting hash to v1

Mark clientapproval as broken because of incorrect client_id parsing
This commit is contained in:
Širhoe Biazhkovič
2021-10-27 16:48:28 +03:00
committed by Lawrence, Rendall
parent 2f092bad45
commit af1cbc543c
6 changed files with 46 additions and 48 deletions

View File

@@ -16,14 +16,10 @@ type benchData struct {
}
func generateInfohashes() (a [1000]bittorrent.InfoHash) {
r := rand.New(rand.NewSource(0))
for i := range a {
b := [20]byte{}
n, err := r.Read(b[:])
if err != nil || n != 20 {
panic("unable to create random bytes")
}
a[i] = bittorrent.InfoHash(b)
b := make([]byte, 20)
rand.Read(b)
a[i], _ = bittorrent.InfoHashFromBytes(b)
}
return
@@ -44,7 +40,7 @@ func generatePeers() (a [1000]bittorrent.Peer) {
}
port := uint16(r.Uint32())
a[i] = bittorrent.Peer{
ID: bittorrent.PeerID(id),
ID: id,
IP: bittorrent.IP{IP: net.IP(ip), AddressFamily: bittorrent.IPv4},
Port: port,
}