OSDN Git Service

fix bug (#160)
authorPaladz <yzhu101@uottawa.ca>
Wed, 12 Jun 2019 05:50:32 +0000 (13:50 +0800)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2019 05:50:32 +0000 (13:50 +0800)
* fix bug

* fix bug

protocol/consensus_node_manager.go

index a941860..136fb6a 100644 (file)
@@ -106,10 +106,15 @@ func (c *consensusNodeManager) getConsensusNodes(prevBlockHash *bc.Hash) (map[st
                return nil, err
        }
 
-       if len(voteResult.NumOfVote) == 0 {
-               return federationNodes(), nil
+       result, err := voteResult.ConsensusNodes()
+       if err != nil {
+               return nil, err
+       }
+
+       if len(result) != 0 {
+               return result, nil
        }
-       return voteResult.ConsensusNodes()
+       return federationNodes(), nil
 }
 
 func (c *consensusNodeManager) getBestVoteResult() (*state.VoteResult, error) {