Compare blockhashes in stageBlock()

This commit is contained in:
Jae Kwon
2015-03-26 10:58:20 -07:00
parent bd767c1fab
commit fd0646fc4f
4 changed files with 22 additions and 7 deletions

View File

@ -1015,7 +1015,8 @@ func (cs *ConsensusState) stageBlock(block *types.Block, blockParts *types.PartS
}
// Already staged?
if cs.stagedBlock == block {
blockHash := block.Hash()
if cs.stagedBlock != nil && len(blockHash) != 0 && bytes.Equal(cs.stagedBlock.Hash(), blockHash) {
return nil
}