Commit 903932bc authored by 张振华's avatar 张振华

update

parent a811360e
...@@ -612,8 +612,6 @@ func (cs *ConsensusState) InitTopNCandidators(version int64) { ...@@ -612,8 +612,6 @@ func (cs *ConsensusState) InitTopNCandidators(version int64) {
version-- version--
} }
return
} }
// UpdateTopNCandidators method // UpdateTopNCandidators method
...@@ -706,8 +704,6 @@ func (cs *ConsensusState) InitCycleBoundaryInfo(task Task) { ...@@ -706,8 +704,6 @@ func (cs *ConsensusState) InitCycleBoundaryInfo(task Task) {
//cs.cycleBoundaryMap[task.cycle] = info //cs.cycleBoundaryMap[task.cycle] = info
cs.UpdateCBInfo(info) cs.UpdateCBInfo(info)
} }
return
} }
// UpdateCBInfo method // UpdateCBInfo method
...@@ -928,8 +924,6 @@ func (cs *ConsensusState) InitCycleVrfInfo(task Task) { ...@@ -928,8 +924,6 @@ func (cs *ConsensusState) InitCycleVrfInfo(task Task) {
//cs.cycleBoundaryMap[task.cycle] = info //cs.cycleBoundaryMap[task.cycle] = info
cs.UpdateVrfInfo(info) cs.UpdateVrfInfo(info)
} }
return
} }
// UpdateVrfInfo method // UpdateVrfInfo method
......
...@@ -228,7 +228,7 @@ func checkVrf(cs *ConsensusState) { ...@@ -228,7 +228,7 @@ func checkVrf(cs *ConsensusState) {
} }
func checkTopNRegist(cs *ConsensusState) { func checkTopNRegist(cs *ConsensusState) {
if whetherUpdateTopN == false { if !whetherUpdateTopN {
return return
} }
...@@ -275,7 +275,7 @@ func checkTopNRegist(cs *ConsensusState) { ...@@ -275,7 +275,7 @@ func checkTopNRegist(cs *ConsensusState) {
} }
func checkTopNUpdate(cs *ConsensusState) { func checkTopNUpdate(cs *ConsensusState) {
if whetherUpdateTopN == false { if !whetherUpdateTopN {
return return
} }
......
...@@ -72,11 +72,7 @@ func TestValidator(t *testing.T) { ...@@ -72,11 +72,7 @@ func TestValidator(t *testing.T) {
} }
func match(index int, val *Validator) bool { func match(index int, val *Validator) bool {
if bytes.Equal(val.Address, val1.Address) { return bytes.Equal(val.Address, val1.Address)
return true
}
return false
} }
func TestValidatorSet(t *testing.T) { func TestValidatorSet(t *testing.T) {
......
...@@ -297,9 +297,7 @@ func candidatorQuery(cmd *cobra.Command, args []string) { ...@@ -297,9 +297,7 @@ func candidatorQuery(cmd *cobra.Command, args []string) {
case "pubkeys": case "pubkeys":
keys := strings.Split(pubkeys, ";") keys := strings.Split(pubkeys, ";")
req := &dty.CandidatorQuery{} req := &dty.CandidatorQuery{}
for _, key := range keys { req.Pubkeys = append(req.Pubkeys, keys...)
req.Pubkeys = append(req.Pubkeys, key)
}
params.FuncName = dty.FuncNameQueryCandidatorByPubkeys params.FuncName = dty.FuncNameQueryCandidatorByPubkeys
params.Payload = types.MustPBToJSON(req) params.Payload = types.MustPBToJSON(req)
var res dty.CandidatorReply var res dty.CandidatorReply
...@@ -337,9 +335,7 @@ func voteQuery(cmd *cobra.Command, args []string) { ...@@ -337,9 +335,7 @@ func voteQuery(cmd *cobra.Command, args []string) {
} }
keys := strings.Split(pubkeys, ";") keys := strings.Split(pubkeys, ";")
for _, key := range keys { req.Pubkeys = append(req.Pubkeys, keys...)
req.Pubkeys = append(req.Pubkeys, key)
}
params.FuncName = dty.FuncNameQueryVote params.FuncName = dty.FuncNameQueryVote
params.Payload = types.MustPBToJSON(req) params.Payload = types.MustPBToJSON(req)
...@@ -548,9 +544,7 @@ func vrfQuery(cmd *cobra.Command, args []string) { ...@@ -548,9 +544,7 @@ func vrfQuery(cmd *cobra.Command, args []string) {
} }
keys := strings.Split(pubkeys, ";") keys := strings.Split(pubkeys, ";")
for _, key := range keys { req.Pubkeys = append(req.Pubkeys, keys...)
req.Pubkeys = append(req.Pubkeys, key)
}
params.FuncName = dty.FuncNameQueryVrfByCycleForPubkeys params.FuncName = dty.FuncNameQueryVrfByCycleForPubkeys
params.Payload = types.MustPBToJSON(req) params.Payload = types.MustPBToJSON(req)
......
...@@ -190,7 +190,7 @@ func queryVrfByCycleAndPubkeys(kvdb db.KVDB, pubkeys []string, cycle int64) []*d ...@@ -190,7 +190,7 @@ func queryVrfByCycleAndPubkeys(kvdb db.KVDB, pubkeys []string, cycle int64) []*d
vrfs = append(vrfs, vrf) vrfs = append(vrfs, vrf)
} }
if tempPubkeys == nil || len(tempPubkeys) == 0 { if len(tempPubkeys) == 0 {
return vrfs return vrfs
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment