mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/blockchain: remove excessive check
This commit removes unnecessary check during rewinding procedure. While the excessive check does help with clarity, related variables are nearby this check to aid with readablity.
This commit is contained in:
parent
4e1e37323d
commit
3d5ba82581
1 changed files with 2 additions and 2 deletions
|
|
@ -672,8 +672,8 @@ func (bc *BlockChain) setHeadBeyondRoot(head uint64, time uint64, root common.Ha
|
||||||
beyondRoot := (root == common.Hash{}) // Flag whether we're beyond the requested root (no root, always true)
|
beyondRoot := (root == common.Hash{}) // Flag whether we're beyond the requested root (no root, always true)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// If a root threshold was requested but not yet crossed, check
|
// Check if the root threshold is crossed
|
||||||
if root != (common.Hash{}) && !beyondRoot && newHeadBlock.Root() == root {
|
if !beyondRoot && newHeadBlock.Root() == root {
|
||||||
beyondRoot, rootNumber = true, newHeadBlock.NumberU64()
|
beyondRoot, rootNumber = true, newHeadBlock.NumberU64()
|
||||||
}
|
}
|
||||||
if !bc.HasState(newHeadBlock.Root()) && !bc.stateRecoverable(newHeadBlock.Root()) {
|
if !bc.HasState(newHeadBlock.Root()) && !bc.stateRecoverable(newHeadBlock.Root()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue