nextBlockTime = minNextBlockTime
}
- if isBlocker, err := b.chain.IsBlocker(&bestBlockHash, xpubStr, nextBlockTime); !isBlocker {
- log.WithFields(log.Fields{"module": logModule, "error": err, "pubKey": xpubStr}).Debug("fail on check is next blocker")
+ isBlocker, err := b.chain.IsBlocker(&bestBlockHash, xpubStr, nextBlockTime)
+ if err != nil {
+ log.WithFields(log.Fields{"module": logModule, "error": err, "pubKey": xpubStr}).Error("fail on check is next blocker")
+ continue
+ }
+
+ if !isBlocker {
continue
}
}
seqHeight := prevBlockNode.Height + 1
- if bestHeight := c.blockIndex.BestNode().Height; bestHeight < seqHeight {
+ if bestHeight := c.blockIndex.BestNode().Height; bestHeight < seqHeight && bestHeight != 0 {
seqHeight = bestHeight
}
func (c *consensusNodeManager) getBestVoteResult() (*state.VoteResult, error) {
blockNode := c.blockIndex.BestNode()
+ if blockNode.Height == 0 {
+ return c.store.GetVoteResult(0)
+ }
+
seq := (blockNode.Height-1)/consensus.RoundVoteBlockNums + 1
voteResult, err := c.store.GetVoteResult(seq)
if err != nil {