Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multisend
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
李伟@五瓣科技
multisend
Commits
ed57a11b
Commit
ed57a11b
authored
Mar 08, 2022
by
李伟@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count batch hash
parent
f6fa7e28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
http.go
http.go
+4
-8
redis.go
redis.go
+7
-1
No files found.
http.go
View file @
ed57a11b
...
...
@@ -484,17 +484,13 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in
total
:=
txCount
if
fromAddr
!=
systemFromAddr
&&
first
{
if
fromAddr
!=
systemFromAddr
{
total
=
total
+
1
}
for
;
;
consTxNum
++
{
total
=
total
-
batchTxHashSize
*
batchTxSize
if
total
<=
0
{
break
}
consTxNum
=
total
/
(
batchTxHashSize
*
batchTxSize
)
if
total
%
(
batchTxHashSize
*
batchTxSize
)
!=
0
{
consTxNum
=
consTxNum
+
1
}
SetSendRecord
(
id
,
SendRecord
{
TotalConsTx
:
int64
(
consTxNum
)})
...
...
redis.go
View file @
ed57a11b
...
...
@@ -49,6 +49,8 @@ func Start(redisAddr, passwd string) {
logTicker
:=
time
.
NewTicker
(
5
*
time
.
Second
)
count
:=
0
for
{
limiter
.
Wait
(
cxt
)
select
{
...
...
@@ -81,17 +83,21 @@ func Start(redisAddr, passwd string) {
panic
(
err
)
}
fmt
.
Printf
(
"batchTxs.Hash: %x count: %d
\n
"
,
batchTxs
.
Hash
,
count
)
if
err
:=
client
.
LPush
(
context
.
Background
(),
"list"
,
batchTxsAsBytes
)
.
Err
();
err
!=
nil
{
panic
(
err
)
}
count
++
hashstr
:=
[]
string
{}
for
_
,
v
:=
range
hashs
{
hashstr
=
append
(
hashstr
,
v
.
Hex
())
}
fmt
.
Printf
(
"batchTxHash %s listLen: %d list: %v
\n
"
,
fmt
.
Sprintf
(
"%x"
,
batchTxs
.
Hash
),
len
(
hashstr
),
hashstr
)
//
fmt.Printf("batchTxHash %s listLen: %d list: %v \n", fmt.Sprintf("%x", batchTxs.Hash), len(hashstr), hashstr)
if
err
:=
client
.
LPush
(
context
.
Background
(),
fmt
.
Sprintf
(
"%x"
,
batchTxs
.
Hash
),
hashstr
);
err
!=
nil
{
...
...
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