mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network/stream: removed REPEAT retry loop
This commit is contained in:
parent
f8518d26c6
commit
25831b3bf2
1 changed files with 30 additions and 37 deletions
|
|
@ -274,8 +274,6 @@ func runPureRetrievalTest(nodeCount int, chunkCount int) error {
|
|||
log.Debug("starting retrieval")
|
||||
cnt := 0
|
||||
|
||||
REPEAT:
|
||||
for {
|
||||
for _, id := range nodeIDs {
|
||||
item, ok := sim.NodeItem(id, bucketKeyFileStore)
|
||||
if !ok {
|
||||
|
|
@ -302,17 +300,12 @@ func runPureRetrievalTest(nodeCount int, chunkCount int) error {
|
|||
ok = false
|
||||
}
|
||||
if !ok {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
// we continue trying if it failed
|
||||
continue REPEAT
|
||||
return fmt.Errorf("Expected test to succeed at first run, but failed with chunk not found")
|
||||
}
|
||||
log.Debug(fmt.Sprintf("chunk with root hash %x successfully retrieved", chunk.Address()))
|
||||
cnt++
|
||||
}
|
||||
}
|
||||
// we iterate sequentially, one after the other, so at this point we got all chunks
|
||||
break
|
||||
}
|
||||
log.Info("retrieval terminated, chunks retrieved: ", "count", cnt)
|
||||
return nil
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue