From edeb518670d435eaf4525814f715d681c5bb71bc Mon Sep 17 00:00:00 2001 From: Paladz Date: Wed, 12 Jun 2019 13:50:32 +0800 Subject: [PATCH] fix bug (#160) * fix bug * fix bug --- protocol/consensus_node_manager.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/protocol/consensus_node_manager.go b/protocol/consensus_node_manager.go index a941860f..136fb6ae 100644 --- a/protocol/consensus_node_manager.go +++ b/protocol/consensus_node_manager.go @@ -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) { -- 2.11.0