cmd/swarm-smoke: fix what we wanted to avoid (#1486)
This commit is contained in:
@ -39,8 +39,6 @@ import (
|
||||
cli "gopkg.in/urfave/cli.v1"
|
||||
)
|
||||
|
||||
const trackChunksPageSize = 7500
|
||||
|
||||
func uploadAndSyncCmd(ctx *cli.Context) error {
|
||||
// use input seed if it has been set
|
||||
if inputSeed != 0 {
|
||||
@ -180,13 +178,14 @@ func trackChunks(testData []byte, submitMetrics bool) error {
|
||||
// getChunksBitVectorFromHost returns a bit vector of presence for a given slice of chunks from a given host
|
||||
func getChunksBitVectorFromHost(client *rpc.Client, addrs []storage.Address) (string, error) {
|
||||
var hostChunks string
|
||||
const trackChunksPageSize = 7500
|
||||
|
||||
for len(addrs) > 0 {
|
||||
var pageChunks string
|
||||
// get current page size, so that we avoid a slice out of bounds on the last page
|
||||
pagesize := trackChunksPageSize
|
||||
if cap(addrs) < trackChunksPageSize {
|
||||
pagesize = cap(addrs)
|
||||
if len(addrs) < trackChunksPageSize {
|
||||
pagesize = len(addrs)
|
||||
}
|
||||
|
||||
err := client.Call(&pageChunks, "bzz_has", addrs[:pagesize])
|
||||
|
Reference in New Issue
Block a user