diff --git a/client/txgen/main.go b/client/txgen/main.go index 965c53189..86e7ab6d9 100644 --- a/client/txgen/main.go +++ b/client/txgen/main.go @@ -98,11 +98,8 @@ UTXOLOOP: for index, value := range utxoMap { txInfo.index = index txInfo.value = value - if txInfo.txCount >= setting.maxNumTxsPerBatch { - break UTXOLOOP - } - randNum := rand.Intn(100) + randNum := rand.Intn(100) // 30% sample rate to select UTXO to use for new transactions if randNum >= 30 { continue @@ -112,6 +109,9 @@ UTXOLOOP: } else { generateSingleShardTx(txInfo) } + if txInfo.txCount >= setting.maxNumTxsPerBatch { + break UTXOLOOP + } } } }