Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
ff3f4caf
Commit
ff3f4caf
authored
Apr 29, 2019
by
kingwang
Committed by
vipwzw
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del retry
parent
1b69df3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
base.go
plugin/mempool/para/base.go
+5
-13
No files found.
plugin/mempool/para/base.go
View file @
ff3f4caf
...
@@ -3,7 +3,6 @@ package para
...
@@ -3,7 +3,6 @@ package para
import
(
import
(
"context"
"context"
"sync/atomic"
"sync/atomic"
"time"
"sync"
"sync"
...
@@ -13,7 +12,6 @@ import (
...
@@ -13,7 +12,6 @@ import (
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
)
)
var
retry_times
=
3
var
mlog
=
log
.
New
(
"module"
,
"mempool.para"
)
var
mlog
=
log
.
New
(
"module"
,
"mempool.para"
)
var
topic
=
"mempool"
var
topic
=
"mempool"
...
@@ -52,17 +50,11 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
...
@@ -52,17 +50,11 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
case
types
.
EventTx
:
case
types
.
EventTx
:
mlog
.
Info
(
"Receive msg from para mempool"
)
mlog
.
Info
(
"Receive msg from para mempool"
)
tx
:=
msg
.
GetData
()
.
(
*
types
.
Transaction
)
tx
:=
msg
.
GetData
()
.
(
*
types
.
Transaction
)
for
i
:=
0
;
i
<
retry_times
;
i
++
{
reply
,
err
:=
mem
.
mainGrpcCli
.
SendTransaction
(
context
.
Background
(),
tx
)
reply
,
err
:=
mem
.
mainGrpcCli
.
SendTransaction
(
context
.
Background
(),
tx
)
if
err
!=
nil
{
if
err
==
nil
{
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
err
))
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
&
types
.
Reply
{
IsOk
:
true
,
Msg
:
reply
.
GetMsg
()}))
}
else
{
break
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
reply
))
}
else
if
err
!=
nil
&&
i
!=
retry_times
-
1
{
time
.
Sleep
(
time
.
Millisecond
*
10
)
continue
}
else
{
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
err
))
}
}
}
default
:
default
:
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
types
.
ErrActionNotSupport
))
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
types
.
ErrActionNotSupport
))
...
...
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