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
b2b62fd4
Commit
b2b62fd4
authored
Jun 05, 2019
by
mdj33
Committed by
vipwzw
Jun 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajust sending height once wallet open
parent
02189b7a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
paracommitmsg.go
plugin/consensus/para/paracommitmsg.go
+5
-2
rpc.go
plugin/dapp/paracross/rpc/rpc.go
+28
-1
No files found.
plugin/consensus/para/paracommitmsg.go
View file @
b2b62fd4
...
...
@@ -40,6 +40,7 @@ func (client *commitMsgClient) handler() {
var
isRollback
bool
var
notification
[]
int64
//记录每次系统重启后 min and current height
var
finishHeight
int64
var
consensHeight
int64
var
sendingHeight
int64
//当前发送的最大高度
var
sendingMsgs
[]
*
pt
.
ParacrossNodeStatus
var
readTick
<-
chan
time
.
Time
...
...
@@ -155,7 +156,7 @@ out:
//获取正在共识的高度,同步有两层意思,一个是主链跟其他节点完成了同步,另一个是当前平行链节点的高度追赶上了共识高度
//一般来说高度增长从小到大: notifiy[0] -- selfConsensusHeight(mainHeight) -- finishHeight -- sendingHeight -- notify[1]
case
rsp
:=
<-
consensusCh
:
consensHeight
:
=
rsp
.
Height
consensHeight
=
rsp
.
Height
plog
.
Info
(
"para consensus rcv"
,
"notify"
,
notification
,
"sending"
,
len
(
sendingMsgs
),
"consensHeigt"
,
rsp
.
Height
,
"finished"
,
finishHeight
,
"sync"
,
isSync
,
"miner"
,
readTick
!=
nil
,
"consensBlockHash"
,
common
.
ToHex
(
rsp
.
BlockHash
))
...
...
@@ -193,7 +194,6 @@ out:
finishHeight
=
consensHeight
sendingMsgs
=
nil
client
.
currentTx
=
nil
isSync
=
true
}
case
miner
:=
<-
client
.
minerSwitch
:
...
...
@@ -212,6 +212,9 @@ out:
ticker
=
time
.
NewTicker
(
time
.
Second
*
time
.
Duration
(
minerInterval
))
readTick
=
ticker
.
C
plog
.
Info
(
"para consensus start mining"
)
//钱包开启后,从共识高度重新开始发送,在需要重发共识时候,不需要重启设备
finishHeight
=
consensHeight
}
case
<-
client
.
quit
:
...
...
plugin/dapp/paracross/rpc/rpc.go
View file @
b2b62fd4
...
...
@@ -49,6 +49,9 @@ func (c *Jrpc) GetHeight(req *types.ReqString, result *interface{}) error {
}
data
,
err
:=
c
.
cli
.
GetTitle
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
*
data
return
err
...
...
@@ -68,6 +71,9 @@ func (c *channelClient) ListTitles(ctx context.Context, req *types.ReqNil) (*pt.
// ListTitles get paracross consensus titles list
func
(
c
*
Jrpc
)
ListTitles
(
req
*
types
.
ReqNil
,
result
*
interface
{})
error
{
data
,
err
:=
c
.
cli
.
ListTitles
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
data
return
err
}
...
...
@@ -89,6 +95,9 @@ func (c *Jrpc) GetTitleHeight(req *pt.ReqParacrossTitleHeight, result *interface
return
types
.
ErrInvalidParam
}
data
,
err
:=
c
.
cli
.
GetTitleHeight
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
data
return
err
}
...
...
@@ -121,6 +130,9 @@ func (c *Jrpc) GetAssetTxResult(req *types.ReqHash, result *interface{}) error {
return
types
.
ErrInvalidParam
}
data
,
err
:=
c
.
cli
.
GetAssetTxResult
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
data
return
err
}
...
...
@@ -175,8 +187,11 @@ func (c *Jrpc) GetBlock2MainInfo(req *types.ReqBlocks, result *interface{}) erro
}
ret
,
err
:=
c
.
cli
.
GetBlock2MainInfo
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
*
ret
return
err
return
nil
}
// GetNodeAddrStatus get super node status
...
...
@@ -245,6 +260,9 @@ func (c *channelClient) ListNodeStatus(ctx context.Context, req *pt.ReqParacross
//ListNodeStatus list super node by status
func
(
c
*
Jrpc
)
ListNodeStatus
(
req
*
pt
.
ReqParacrossNodeInfo
,
result
*
interface
{})
error
{
data
,
err
:=
c
.
cli
.
ListNodeStatus
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
data
return
err
}
...
...
@@ -265,6 +283,9 @@ func (c *channelClient) GetNodeGroupAddrs(ctx context.Context, req *pt.ReqParacr
// GetNodeGroupAddrs get super node group addrs
func
(
c
*
Jrpc
)
GetNodeGroupAddrs
(
req
*
pt
.
ReqParacrossNodeInfo
,
result
*
interface
{})
error
{
data
,
err
:=
c
.
cli
.
GetNodeGroupAddrs
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
data
return
err
}
...
...
@@ -285,6 +306,9 @@ func (c *channelClient) GetNodeGroupStatus(ctx context.Context, req *pt.ReqParac
// GetNodeGroupStatus get super node group status
func
(
c
*
Jrpc
)
GetNodeGroupStatus
(
req
*
pt
.
ReqParacrossNodeInfo
,
result
*
interface
{})
error
{
data
,
err
:=
c
.
cli
.
GetNodeGroupStatus
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
data
return
err
}
...
...
@@ -305,6 +329,9 @@ func (c *channelClient) ListNodeGroupStatus(ctx context.Context, req *pt.ReqPara
//ListNodeGroupStatus list super node group by status
func
(
c
*
Jrpc
)
ListNodeGroupStatus
(
req
*
pt
.
ReqParacrossNodeInfo
,
result
*
interface
{})
error
{
data
,
err
:=
c
.
cli
.
ListNodeGroupStatus
(
context
.
Background
(),
req
)
if
err
!=
nil
{
return
err
}
*
result
=
data
return
err
}
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