diff --git a/p2p/integrationtest/real-bidder/main.go b/p2p/integrationtest/real-bidder/main.go index b02943058..3159b7889 100644 --- a/p2p/integrationtest/real-bidder/main.go +++ b/p2p/integrationtest/real-bidder/main.go @@ -224,17 +224,13 @@ func main() { continue } - bundleLen := rand.Intn(10) - bundleStart := rand.Intn(len(currentBlock.txns) - 1) - bundleEnd := bundleStart + bundleLen - if bundleEnd > len(currentBlock.txns) { - bundleEnd = len(currentBlock.txns) - 1 - } + bundleStart := rand.Intn(len(currentBlock.txns)) + bundleEnd := min(bundleStart+rand.Intn(10), len(currentBlock.txns)-1) + + const dMin, dMax = 5000, 10000 + startTimeDiff := rand.Int63n(dMax-dMin+1) + dMin + endTimeDiff := rand.Int63n(dMax-dMin+1) + dMin - min := 5000 - max := 10000 - startTimeDiff := rand.Intn(max-min+1) + min - endTimeDiff := rand.Intn(max-min+1) + min err = sendBid( bidderClient, logger,