OSDN Git Service

fix bug (#160)
[bytom/vapor.git] / 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) {