Compare by block timestamp if stake is equal in block selection mechanism
This commit is contained in:
parent
65afa056bb
commit
7e80654c87
@ -384,12 +384,11 @@ func (pcm *PBFTConsensusManager) commitAcceptedBlocks() (*types3.Block, error) {
|
|||||||
|
|
||||||
if iStake.Cmp(jStake) == -1 {
|
if iStake.Cmp(jStake) == -1 {
|
||||||
return false
|
return false
|
||||||
}
|
} else if iStake.Cmp(jStake) == 1 {
|
||||||
if iStake.Cmp(jStake) == 1 {
|
|
||||||
return true
|
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
|
selectedBlock = blocks[0].Block
|
||||||
|
Loading…
Reference in New Issue
Block a user