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
903932bc
Commit
903932bc
authored
Sep 04, 2019
by
张振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a811360e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
23 deletions
+7
-23
consensus_state.go
plugin/consensus/dpos/consensus_state.go
+0
-6
state_machine.go
plugin/consensus/dpos/state_machine.go
+2
-2
validator_set_test.go
plugin/consensus/dpos/types/validator_set_test.go
+1
-5
vote.go
plugin/dapp/dposvote/commands/vote.go
+3
-9
dposvotedb.go
plugin/dapp/dposvote/executor/dposvotedb.go
+1
-1
No files found.
plugin/consensus/dpos/consensus_state.go
View file @
903932bc
...
...
@@ -612,8 +612,6 @@ func (cs *ConsensusState) InitTopNCandidators(version int64) {
version
--
}
return
}
// UpdateTopNCandidators method
...
...
@@ -706,8 +704,6 @@ func (cs *ConsensusState) InitCycleBoundaryInfo(task Task) {
//cs.cycleBoundaryMap[task.cycle] = info
cs
.
UpdateCBInfo
(
info
)
}
return
}
// UpdateCBInfo method
...
...
@@ -928,8 +924,6 @@ func (cs *ConsensusState) InitCycleVrfInfo(task Task) {
//cs.cycleBoundaryMap[task.cycle] = info
cs
.
UpdateVrfInfo
(
info
)
}
return
}
// UpdateVrfInfo method
...
...
plugin/consensus/dpos/state_machine.go
View file @
903932bc
...
...
@@ -228,7 +228,7 @@ func checkVrf(cs *ConsensusState) {
}
func
checkTopNRegist
(
cs
*
ConsensusState
)
{
if
whetherUpdateTopN
==
false
{
if
!
whetherUpdateTopN
{
return
}
...
...
@@ -275,7 +275,7 @@ func checkTopNRegist(cs *ConsensusState) {
}
func
checkTopNUpdate
(
cs
*
ConsensusState
)
{
if
whetherUpdateTopN
==
false
{
if
!
whetherUpdateTopN
{
return
}
...
...
plugin/consensus/dpos/types/validator_set_test.go
View file @
903932bc
...
...
@@ -72,11 +72,7 @@ func TestValidator(t *testing.T) {
}
func
match
(
index
int
,
val
*
Validator
)
bool
{
if
bytes
.
Equal
(
val
.
Address
,
val1
.
Address
)
{
return
true
}
return
false
return
bytes
.
Equal
(
val
.
Address
,
val1
.
Address
)
}
func
TestValidatorSet
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/dposvote/commands/vote.go
View file @
903932bc
...
...
@@ -297,9 +297,7 @@ func candidatorQuery(cmd *cobra.Command, args []string) {
case
"pubkeys"
:
keys
:=
strings
.
Split
(
pubkeys
,
";"
)
req
:=
&
dty
.
CandidatorQuery
{}
for
_
,
key
:=
range
keys
{
req
.
Pubkeys
=
append
(
req
.
Pubkeys
,
key
)
}
req
.
Pubkeys
=
append
(
req
.
Pubkeys
,
keys
...
)
params
.
FuncName
=
dty
.
FuncNameQueryCandidatorByPubkeys
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
dty
.
CandidatorReply
...
...
@@ -337,9 +335,7 @@ func voteQuery(cmd *cobra.Command, args []string) {
}
keys
:=
strings
.
Split
(
pubkeys
,
";"
)
for
_
,
key
:=
range
keys
{
req
.
Pubkeys
=
append
(
req
.
Pubkeys
,
key
)
}
req
.
Pubkeys
=
append
(
req
.
Pubkeys
,
keys
...
)
params
.
FuncName
=
dty
.
FuncNameQueryVote
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
...
...
@@ -548,9 +544,7 @@ func vrfQuery(cmd *cobra.Command, args []string) {
}
keys
:=
strings
.
Split
(
pubkeys
,
";"
)
for
_
,
key
:=
range
keys
{
req
.
Pubkeys
=
append
(
req
.
Pubkeys
,
key
)
}
req
.
Pubkeys
=
append
(
req
.
Pubkeys
,
keys
...
)
params
.
FuncName
=
dty
.
FuncNameQueryVrfByCycleForPubkeys
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
...
...
plugin/dapp/dposvote/executor/dposvotedb.go
View file @
903932bc
...
...
@@ -190,7 +190,7 @@ func queryVrfByCycleAndPubkeys(kvdb db.KVDB, pubkeys []string, cycle int64) []*d
vrfs
=
append
(
vrfs
,
vrf
)
}
if
tempPubkeys
==
nil
||
len
(
tempPubkeys
)
==
0
{
if
len
(
tempPubkeys
)
==
0
{
return
vrfs
}
...
...
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