mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/swarm/swarm-smoke: remove redundant traces
This commit is contained in:
parent
0240a904b5
commit
867fed2d94
1 changed files with 6 additions and 16 deletions
|
|
@ -68,55 +68,45 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func trackChunks(testData []byte) error {
|
func trackChunks(testData []byte) error {
|
||||||
log.Warn("Test timed out; running chunk debug sequence")
|
log.Warn("Test timed out, running chunk debug sequence")
|
||||||
|
|
||||||
addrs, err := getAllRefs(testData)
|
addrs, err := getAllRefs(testData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Trace("All references retrieved")
|
|
||||||
|
|
||||||
for i, ref := range addrs {
|
for i, ref := range addrs {
|
||||||
log.Trace(fmt.Sprintf("ref %d", i), "ref", ref)
|
log.Trace(fmt.Sprintf("ref %d", i), "ref", ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
// has-chunks
|
|
||||||
for _, host := range hosts {
|
for _, host := range hosts {
|
||||||
httpHost := fmt.Sprintf("ws://%s:%d", host, 8546)
|
httpHost := fmt.Sprintf("ws://%s:%d", host, 8546)
|
||||||
log.Trace("Calling `Has` on host", "httpHost", httpHost)
|
|
||||||
|
|
||||||
hostChunks := []string{}
|
hostChunks := []string{}
|
||||||
|
|
||||||
rpcClient, err := rpc.Dial(httpHost)
|
rpcClient, err := rpc.Dial(httpHost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Trace("Error dialing host", "err", err)
|
log.Error("Error dialing host", "err", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Trace("rpc dial ok")
|
|
||||||
var hasInfo []api.HasInfo
|
var hasInfo []api.HasInfo
|
||||||
err = rpcClient.Call(&hasInfo, "bzz_has", addrs)
|
err = rpcClient.Call(&hasInfo, "bzz_has", addrs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Trace("Error calling host", "err", err)
|
log.Error("Error calling host", "err", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Trace("rpc call ok")
|
|
||||||
count := 0
|
count := 0
|
||||||
for i, info := range hasInfo {
|
for i, info := range hasInfo {
|
||||||
if i == 0 {
|
|
||||||
log.Trace("first hasInfo", "addr", info.Addr, "host", host, "i", i)
|
|
||||||
}
|
|
||||||
if i == len(hasInfo)-1 {
|
|
||||||
log.Trace("last hasInfo", "addr", info.Addr, "host", host, "i", i)
|
|
||||||
}
|
|
||||||
|
|
||||||
if info.Has {
|
if info.Has {
|
||||||
hostChunks = append(hostChunks, "1")
|
hostChunks = append(hostChunks, "1")
|
||||||
} else {
|
} else {
|
||||||
hostChunks = append(hostChunks, "0")
|
hostChunks = append(hostChunks, "0")
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if count == 0 {
|
if count == 0 {
|
||||||
log.Info("host reported to have all chunks", "host", host)
|
log.Info("host reported to have all chunks", "host", host)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue