Commit 2d879010 authored by duanjinfei's avatar duanjinfei

fix get fromAddr

parent 932ffbff
...@@ -27,7 +27,7 @@ func init() { ...@@ -27,7 +27,7 @@ func init() {
func startTest() { func startTest() {
if broadcastTxArr { if broadcastTxArr {
SendTxAccountArr = tool.ReadExcelOfStartEnd(startCount, endCount, cfg.StorageAccFileName) SendTxAccountArr = tool.ReadExcelOfStartEnd(startCount, endCount, cfg.StorageAccFileName)
log.Infof("Program start initAccCount:%d tranCount", cfg.Count) log.Infof("Program start initAccCount:%d tranCount", len(SendTxAccountArr))
cfg.GoRoutineCount = goRoutineCount cfg.GoRoutineCount = goRoutineCount
cfg.SignCount = txCount / 100 cfg.SignCount = txCount / 100
cfg.BatchCount = batchCount cfg.BatchCount = batchCount
......
...@@ -111,7 +111,7 @@ func InitAccNonce(sendTxAccountArr [][]string, cfg *tool.Config) (error, sync.Ma ...@@ -111,7 +111,7 @@ func InitAccNonce(sendTxAccountArr [][]string, cfg *tool.Config) (error, sync.Ma
nonceReq := &ring.NonceRequest{ nonceReq := &ring.NonceRequest{
Address: (*metatypes.Address)(fromAddr.Bytes()), Address: (*metatypes.Address)(fromAddr.Bytes()),
} }
ctx, cancel := context.WithTimeout(context.Background(), time.Second*20) ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
defer cancel() defer cancel()
response, err := serviceClient.Nonce(ctx, nonceReq) response, err := serviceClient.Nonce(ctx, nonceReq)
if err != nil { if err != nil {
...@@ -236,7 +236,7 @@ func NoSignTxArr(syncMap sync.Map, sendTxAccountArr [][]string, cfg *tool.Config ...@@ -236,7 +236,7 @@ func NoSignTxArr(syncMap sync.Map, sendTxAccountArr [][]string, cfg *tool.Config
Data: nil, Data: nil,
} }
newtx := types.NewTx(&txData) newtx := types.NewTx(&txData)
txcache.Add(common.HexToHash(fromAddr+string(signCount)).Hex(), fromAddr) txcache.Add(fromAddr+string(signCount), fromAddr)
signTranArr.TranArr = append(signTranArr.TranArr, newtx) signTranArr.TranArr = append(signTranArr.TranArr, newtx)
nonce = big.NewInt(1).Add(nonce, big.NewInt(1)) nonce = big.NewInt(1).Add(nonce, big.NewInt(1))
} }
......
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