Skip to content

Commit

Permalink
to avoid waiting 50 seconds after the transmission is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanz0g committed Oct 21, 2024
1 parent 6218e4d commit 0e0d74c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/cmd/run/ethlistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,20 @@ func (el *EthereumListener) handleBlockResponse(response map[string]interface{})
// exit if total tx count is less than 100
fmt.Println("Best TPS:", el.bestTPS, "GasUsed%:", el.gasUsedAtBestTPS*100)
el.Close()
return
}

// to avoid waiting 50 seconds after the transmission is complete
if len(el.blockStat) >= 3 {
for i := 1; i <=3; i ++ {
if el.blockStat[len(el.blockStat)-i].TxCount != 0 {
return
}
}
fmt.Println("Best TPS:", el.bestTPS, "GasUsed%:", el.gasUsedAtBestTPS)
el.Close()
}

}
}
}
Expand Down

0 comments on commit 0e0d74c

Please sign in to comment.