Commit f8a0dbe3 authored by duanjinfei's avatar duanjinfei

add time sleep

parent 7e5d868c
......@@ -5,6 +5,7 @@ import (
"ChainGrpcTest/tool"
"ChainGrpcTest/transaction"
"sync"
"time"
)
var (
......@@ -38,20 +39,20 @@ func startTest() {
if err := transaction.InitBroadcastTxGoroutine(cfg); err != nil {
log.Errorf("Init broadcast tx goroutine error: %s", err)
}
for i := 0; i < cfg.GoRoutineCount; i++ {
go func() {
for {
select {
case arr := <-tranArrChan:
log.Info("tranArrChan len:", len(tranArrChan))
log.Info("-----into tranArrChan-----")
if err := transaction.BroadcastTxArr(arr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err)
}
//for i := 0; i < cfg.GoRoutineCount; i++ {
go func() {
for {
select {
case arr := <-tranArrChan:
log.Info("tranArrChan len:", len(tranArrChan))
log.Info("-----into tranArrChan-----")
if err := transaction.BroadcastTxArr(arr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err)
}
}
}()
}
}
}()
//}
for {
log.Info("----------------------------------start")
//arr := transaction.SignedTxArr(syncMap, SendTxAccountArr, cfg)
......@@ -59,6 +60,7 @@ func startTest() {
log.Info("----------------------------------end")
tranArrChan <- arr
syncMap = updateNonce(syncMap, cfg)
time.Sleep(time.Second * 10)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment