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
703449dc
Commit
703449dc
authored
May 07, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
14b1bbc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
paracommitmsg.go
plugin/consensus/para/paracommitmsg.go
+10
-12
No files found.
plugin/consensus/para/paracommitmsg.go
View file @
703449dc
...
@@ -154,7 +154,7 @@ out:
...
@@ -154,7 +154,7 @@ out:
case
rsp
:=
<-
consensusCh
:
case
rsp
:=
<-
consensusCh
:
consensHeight
:=
rsp
.
Height
consensHeight
:=
rsp
.
Height
plog
.
Info
(
"para consensus rcv"
,
"notify"
,
notification
,
"sending"
,
len
(
sendingMsgs
),
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
))
"consensHeigt"
,
rsp
.
Height
,
"finished"
,
finishHeight
,
"sync"
,
isSync
,
"miner"
,
readTick
!=
nil
,
"consensBlockHash"
,
common
.
ToHex
(
rsp
.
BlockHash
))
if
notification
==
nil
||
isRollback
{
if
notification
==
nil
||
isRollback
{
continue
continue
...
@@ -194,18 +194,18 @@ out:
...
@@ -194,18 +194,18 @@ out:
}
}
case
miner
:=
<-
client
.
minerSwitch
:
case
miner
:=
<-
client
.
minerSwitch
:
plog
.
Info
(
"para consensus mining"
,
"miner"
,
miner
)
plog
.
Info
(
"para consensus mining"
,
"miner"
,
miner
)
//停止挖矿
//停止挖矿
if
!
miner
{
if
!
miner
{
readTick
=
nil
readTick
=
nil
if
ticker
!=
nil
{
if
ticker
!=
nil
{
ticker
.
Stop
()
ticker
.
Stop
()
}
}
plog
.
Info
(
"para consensus stop mining"
)
plog
.
Info
(
"para consensus stop mining"
)
continue
continue
}
}
//开启挖矿
//开启挖矿
if
client
.
privateKey
!=
nil
&&
readTick
==
nil
{
if
client
.
privateKey
!=
nil
&&
readTick
==
nil
{
ticker
=
time
.
NewTicker
(
time
.
Second
*
time
.
Duration
(
minerInterval
))
ticker
=
time
.
NewTicker
(
time
.
Second
*
time
.
Duration
(
minerInterval
))
readTick
=
ticker
.
C
readTick
=
ticker
.
C
plog
.
Info
(
"para consensus start mining"
)
plog
.
Info
(
"para consensus start mining"
)
...
@@ -585,10 +585,10 @@ func (client *commitMsgClient) getConsensusStatus(block *types.Block) (*pt.Parac
...
@@ -585,10 +585,10 @@ func (client *commitMsgClient) getConsensusStatus(block *types.Block) (*pt.Parac
}
}
func
(
client
*
commitMsgClient
)
onWalletStatus
(
status
*
types
.
WalletStatus
)
{
func
(
client
*
commitMsgClient
)
onWalletStatus
(
status
*
types
.
WalletStatus
)
{
if
status
==
nil
||
client
.
paraClient
.
authAccount
==
""
{
if
status
==
nil
||
client
.
paraClient
.
authAccount
==
""
{
return
return
}
}
if
!
status
.
IsWalletLock
&&
client
.
privateKey
==
nil
{
if
!
status
.
IsWalletLock
&&
client
.
privateKey
==
nil
{
client
.
fetchPriKey
()
client
.
fetchPriKey
()
plog
.
Info
(
"para commit fetchPriKey"
)
plog
.
Info
(
"para commit fetchPriKey"
)
}
}
...
@@ -599,13 +599,12 @@ func (client *commitMsgClient) onWalletStatus(status *types.WalletStatus) {
...
@@ -599,13 +599,12 @@ func (client *commitMsgClient) onWalletStatus(status *types.WalletStatus) {
}
}
}
}
func
(
client
*
commitMsgClient
)
onWalletAccount
(
acc
*
types
.
Account
)
{
func
(
client
*
commitMsgClient
)
onWalletAccount
(
acc
*
types
.
Account
)
{
if
acc
==
nil
||
client
.
paraClient
.
authAccount
==
""
||
client
.
paraClient
.
authAccount
!=
acc
.
Addr
||
client
.
privateKey
!=
nil
{
if
acc
==
nil
||
client
.
paraClient
.
authAccount
==
""
||
client
.
paraClient
.
authAccount
!=
acc
.
Addr
||
client
.
privateKey
!=
nil
{
return
return
}
}
err
:=
client
.
fetchPriKey
()
err
:=
client
.
fetchPriKey
()
if
err
!=
nil
{
if
err
!=
nil
{
plog
.
Error
(
"para commit fetchPriKey"
,
"err"
,
err
.
Error
())
plog
.
Error
(
"para commit fetchPriKey"
,
"err"
,
err
.
Error
())
return
return
}
}
...
@@ -616,7 +615,7 @@ func (client *commitMsgClient) onWalletAccount(acc *types.Account) {
...
@@ -616,7 +615,7 @@ func (client *commitMsgClient) onWalletAccount(acc *types.Account) {
}
}
}
}
func
(
client
*
commitMsgClient
)
fetchPriKey
()
error
{
func
(
client
*
commitMsgClient
)
fetchPriKey
()
error
{
req
:=
&
types
.
ReqString
{
Data
:
client
.
paraClient
.
authAccount
}
req
:=
&
types
.
ReqString
{
Data
:
client
.
paraClient
.
authAccount
}
msg
:=
client
.
paraClient
.
GetQueueClient
()
.
NewMessage
(
"wallet"
,
types
.
EventDumpPrivkey
,
req
)
msg
:=
client
.
paraClient
.
GetQueueClient
()
.
NewMessage
(
"wallet"
,
types
.
EventDumpPrivkey
,
req
)
...
@@ -651,4 +650,3 @@ func (client *commitMsgClient) fetchPriKey() error {
...
@@ -651,4 +650,3 @@ func (client *commitMsgClient) fetchPriKey() error {
plog
.
Info
(
"para commit fetchPriKey success"
)
plog
.
Info
(
"para commit fetchPriKey success"
)
return
nil
return
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