Commit 12010def authored by duanjinfei's avatar duanjinfei

change continued send tx

parent 3665d079
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"ChainGrpcTest/transaction" "ChainGrpcTest/transaction"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"sync" "sync"
"time"
) )
var ( var (
...@@ -40,6 +41,7 @@ func startTest() { ...@@ -40,6 +41,7 @@ func startTest() {
for { for {
select { select {
case arr := <-tranArrChan: case arr := <-tranArrChan:
log.Info("-----into tranArrChan-----")
if err := transaction.BroadcastTxArr(arr, cfg); err != nil { if err := transaction.BroadcastTxArr(arr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err) log.Errorf("Bath Send Tran error: %s", err)
} }
...@@ -52,7 +54,7 @@ func startTest() { ...@@ -52,7 +54,7 @@ func startTest() {
log.Info("----------------------------------end") log.Info("----------------------------------end")
tranArrChan <- arr tranArrChan <- arr
syncMap = updateNonce(syncMap, cfg) syncMap = updateNonce(syncMap, cfg)
time.Sleep(time.Second * 5)
} }
} }
} }
...@@ -69,7 +71,6 @@ func updateNonce(nonceMap sync.Map, cfg *tool.Config) sync.Map { ...@@ -69,7 +71,6 @@ func updateNonce(nonceMap sync.Map, cfg *tool.Config) sync.Map {
if !ok { if !ok {
return false return false
} }
log.Info("updated addr nonce:", load)
return true return true
}) })
return newNonceMap return newNonceMap
......
...@@ -64,6 +64,7 @@ func BroadcastTxArr(tranArr []*types.Transaction, cfg *tool.Config) error { ...@@ -64,6 +64,7 @@ func BroadcastTxArr(tranArr []*types.Transaction, cfg *tool.Config) error {
log.Infof("Send tran count: %d", bathHandleSendCount) log.Infof("Send tran count: %d", bathHandleSendCount)
log.Infof("Since time: %d ms", time.Since(startTime).Milliseconds()) log.Infof("Since time: %d ms", time.Since(startTime).Milliseconds())
log.Infof("Send tran total time: %d ms", totalSendTime) log.Infof("Send tran total time: %d ms", totalSendTime)
bathHandleSendCount = 0
break break
} }
} }
......
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