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
7b6cf303
Commit
7b6cf303
authored
Apr 25, 2019
by
lilinleeli1234
Committed by
vipwzw
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unsupported msg reply
parent
046c247e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
base.go
plugin/mempool/para/base.go
+7
-5
No files found.
plugin/mempool/para/base.go
View file @
7b6cf303
...
...
@@ -17,14 +17,14 @@ var RETRY_TIMES = 3
//Mempool mempool 基础类
type
Mempool
struct
{
K
ey
string
k
ey
string
mainGrpcCli
types
.
Chain33Client
}
//NewMempool 新建mempool 实例
func
NewMempool
(
cfg
*
types
.
Mempool
)
*
Mempool
{
pool
:=
&
Mempool
{}
pool
.
K
ey
=
topic
pool
.
k
ey
=
topic
if
types
.
IsPara
()
{
grpcCli
,
err
:=
grpcclient
.
NewMainChainClient
(
""
)
if
err
!=
nil
{
...
...
@@ -39,7 +39,7 @@ func NewMempool(cfg *types.Mempool) *Mempool {
//SetQueueClient 初始化mempool模块
func
(
mem
*
Mempool
)
SetQueueClient
(
client
queue
.
Client
)
{
go
func
()
{
client
.
Sub
(
mem
.
K
ey
)
client
.
Sub
(
mem
.
k
ey
)
for
msg
:=
range
client
.
Recv
()
{
switch
msg
.
Ty
{
case
types
.
EventTx
:
...
...
@@ -59,14 +59,16 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
}
}
if
err
!=
nil
{
msg
.
Reply
(
client
.
NewMessage
(
topic
,
types
.
EventReply
,
&
types
.
Reply
{
IsOk
:
false
,
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
&
types
.
Reply
{
IsOk
:
false
,
Msg
:
[]
byte
(
fmt
.
Sprintf
(
"Send transaction to main chain failed, %v"
,
err
))}))
break
}
}
msg
.
Reply
(
client
.
NewMessage
(
topic
,
types
.
EventReply
,
&
types
.
Reply
{
IsOk
:
true
,
Msg
:
[]
byte
(
reply
.
GetMsg
())}))
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
&
types
.
Reply
{
IsOk
:
true
,
Msg
:
[]
byte
(
reply
.
GetMsg
())}))
}
default
:
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
&
types
.
Reply
{
IsOk
:
false
,
Msg
:
[]
byte
(
fmt
.
Sprintf
(
"para %v doesn't handle message %v"
,
mem
.
key
,
msg
.
Ty
))}))
}
}
}()
...
...
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