From 3d5ba8258130db046e93dc5a4f549984e258fe45 Mon Sep 17 00:00:00 2001 From: Hyunchel Kim Date: Mon, 9 Oct 2023 20:18:24 -0400 Subject: [PATCH] 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. --- core/blockchain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index baf2f9f82f..49077d5241 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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) for { - // If a root threshold was requested but not yet crossed, check - if root != (common.Hash{}) && !beyondRoot && newHeadBlock.Root() == root { + // Check if the root threshold is crossed + if !beyondRoot && newHeadBlock.Root() == root { beyondRoot, rootNumber = true, newHeadBlock.NumberU64() } if !bc.HasState(newHeadBlock.Root()) && !bc.stateRecoverable(newHeadBlock.Root()) {