X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=protocol%2Fstate%2Fvote_result.go;fp=protocol%2Fstate%2Fvote_result.go;h=3ab124334d2a1fef6efb07dc8aaa2e81be86cf46;hb=b62a559ff00dffbffe1e2b87288e91f8908e6d04;hp=c9059b2c3f29a6bc6b31ea623f1c92a1be14ebb5;hpb=66150f9e00676848dc38db4d7f1ade26abb0b69b;p=bytom%2Fvapor.git diff --git a/protocol/state/vote_result.go b/protocol/state/vote_result.go index c9059b2c..3ab12433 100644 --- a/protocol/state/vote_result.go +++ b/protocol/state/vote_result.go @@ -4,8 +4,8 @@ import ( "encoding/hex" "sort" - "github.com/vapor/consensus" "github.com/vapor/config" + "github.com/vapor/consensus" "github.com/vapor/crypto/ed25519/chainkd" "github.com/vapor/errors" "github.com/vapor/math/checked" @@ -96,7 +96,7 @@ func (v *VoteResult) ApplyBlock(block *types.Block) error { func (v *VoteResult) ConsensusNodes() (map[string]*ConsensusNode, error) { var nodes []*ConsensusNode for pubkey, voteNum := range v.NumOfVote { - if voteNum >= consensus.MinVoteNum { + if voteNum >= consensus.MinConsensusNodeVoteNum { var xpub chainkd.XPub if err := xpub.UnmarshalText([]byte(pubkey)); err != nil { return nil, err @@ -113,7 +113,7 @@ func (v *VoteResult) ConsensusNodes() (map[string]*ConsensusNode, error) { nodes[i].Order = uint64(i) result[nodes[i].XPub.String()] = nodes[i] } - + if len(result) != 0 { return result, nil }