Compare by block timestamp if stake is equal in block selection mechanism

This commit is contained in:
ChronosX88 2021-08-02 20:28:44 +03:00
parent 65afa056bb
commit 7e80654c87
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A

View File

@ -384,12 +384,11 @@ func (pcm *PBFTConsensusManager) commitAcceptedBlocks() (*types3.Block, error) {
if iStake.Cmp(jStake) == -1 {
return false
}
if iStake.Cmp(jStake) == 1 {
} else if iStake.Cmp(jStake) == 1 {
return true
} else {
return blocks[i].Block.Header.Timestamp > blocks[i].Block.Header.Timestamp
}
return blocks[i].Block.Header.ElectionProof.WinCount > blocks[i].Block.Header.ElectionProof.WinCount
})
selectedBlock = blocks[0].Block