mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +00:00
This commit is contained in:
parent
812abd4b83
commit
7d4578496c
1 changed files with 4 additions and 0 deletions
|
|
@ -2164,6 +2164,10 @@ func (bc *BlockChain) getResultBlock(block *types.Block, verifiedM2 bool) (*Resu
|
||||||
winner = append(winner, parent)
|
winner = append(winner, parent)
|
||||||
parent = bc.GetBlock(parent.ParentHash(), parent.NumberU64()-1)
|
parent = bc.GetBlock(parent.ParentHash(), parent.NumberU64()-1)
|
||||||
}
|
}
|
||||||
|
// fix issue #1765, return at once if winner is empty
|
||||||
|
if len(winner) == 0 {
|
||||||
|
return nil, errors.New("winner is empty")
|
||||||
|
}
|
||||||
for j := 0; j < len(winner)/2; j++ {
|
for j := 0; j < len(winner)/2; j++ {
|
||||||
winner[j], winner[len(winner)-1-j] = winner[len(winner)-1-j], winner[j]
|
winner[j], winner[len(winner)-1-j] = winner[len(winner)-1-j], winner[j]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue