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
c00775bd
Commit
c00775bd
authored
Mar 17, 2022
by
李伟@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use send loop
parent
59adbdf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
root.go
cmd/root.go
+0
-7
http.go
http.go
+6
-3
No files found.
cmd/root.go
View file @
c00775bd
...
@@ -39,13 +39,6 @@ var rootCmd = &cobra.Command{
...
@@ -39,13 +39,6 @@ var rootCmd = &cobra.Command{
Use
:
"sendTxs"
,
Use
:
"sendTxs"
,
Short
:
"send batch txs hash to chain and original txs to redis"
,
Short
:
"send batch txs hash to chain and original txs to redis"
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
//go func() {
// if err := multisend.ProduceOriginalTx(); err != nil {
// panic(err)
// }
//}()
fmt
.
Printf
(
"webStaticDir: %s
\n
"
,
webStaticDir
)
cfg
:=
multisend
.
Config
{
cfg
:=
multisend
.
Config
{
Rate
:
rate
,
Rate
:
rate
,
...
...
http.go
View file @
c00775bd
...
@@ -517,10 +517,13 @@ func (web *WebServicer) TxsHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -517,10 +517,13 @@ func (web *WebServicer) TxsHandler(w http.ResponseWriter, r *http.Request) {
SetSendRecord
(
id
,
SendRecord
{
TotalConsTx
:
int64
(
consTxNum
)})
SetSendRecord
(
id
,
SendRecord
{
TotalConsTx
:
int64
(
consTxNum
)})
go
func
()
{
go
func
()
{
if
err
:=
web
.
ProduceTxs
(
params
.
From
,
params
.
ToAddrs
,
int
(
params
.
TxCount
),
params
.
EveryTxAmount
,
id
,
params
.
RequestAmount
);
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusInternalServerError
)
if
err
:=
web
.
sendLoop
(
params
.
From
,
params
.
ToAddrs
,
int
(
params
.
TxCount
),
params
.
EveryTxAmount
,
id
,
params
.
RequestAmount
);
err
!=
nil
{
return
//if err := web.ProduceTxs(params.From, params.ToAddrs, int(params.TxCount), params.EveryTxAmount, id, params.RequestAmount); err != nil {
fmt
.
Printf
(
"web send loop, id: %s err: %s
\n
"
,
id
,
err
.
Error
())
}
}
atomic
.
StoreInt32
(
&
Running
,
0
)
}()
}()
resAsJson
,
err
:=
json
.
Marshal
(
id
)
resAsJson
,
err
:=
json
.
Marshal
(
id
)
...
...
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