swarm/network: disallow historical retrieval requests (#17936)

This commit is contained in:
Elad
2018-10-19 10:50:25 +02:00
committed by Viktor Trón
parent 97fb08342d
commit aeb733623e
5 changed files with 11 additions and 7 deletions

View File

@@ -218,7 +218,7 @@ func runFileRetrievalTest(nodeCount int) error {
reader, _ := fileStore.Retrieve(context.TODO(), hash)
//check that we can read the file size and that it corresponds to the generated file size
if s, err := reader.Size(ctx, nil); err != nil || s != int64(len(randomFiles[i])) {
log.Warn("Retrieve error", "err", err, "hash", hash, "nodeId", id)
log.Debug("Retrieve error", "err", err, "hash", hash, "nodeId", id)
time.Sleep(500 * time.Millisecond)
continue REPEAT
}
@@ -309,7 +309,7 @@ func runRetrievalTest(chunkCount int, nodeCount int) error {
reader, _ := fileStore.Retrieve(context.TODO(), hash)
//check that we can read the chunk size and that it corresponds to the generated chunk size
if s, err := reader.Size(ctx, nil); err != nil || s != int64(chunkSize) {
log.Warn("Retrieve error", "err", err, "hash", hash, "nodeId", id, "size", s)
log.Debug("Retrieve error", "err", err, "hash", hash, "nodeId", id, "size", s)
time.Sleep(500 * time.Millisecond)
continue REPEAT
}