Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
ChainGrpcPro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanjinfei
ChainGrpcPro
Commits
12010def
Commit
12010def
authored
Mar 10, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change continued send tx
parent
3665d079
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
startTest.go
startTest.go
+3
-2
bathTest.go
transaction/bathTest.go
+1
-0
No files found.
startTest.go
View file @
12010def
...
@@ -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
...
...
transaction/bathTest.go
View file @
12010def
...
@@ -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
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment