mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: polish code
This commit is contained in:
parent
b5df29c693
commit
e3884f146b
1 changed files with 6 additions and 2 deletions
|
|
@ -704,6 +704,10 @@ func (bc *BlockChain) rewindPathHead(root common.Hash) (*types.Header, uint64) {
|
|||
// crossed. The flag value is set to true if the root is empty.
|
||||
beyondRoot = root == common.Hash{}
|
||||
|
||||
// noState represents if the target state requested for search
|
||||
// is unavailable and impossible to be recovered.
|
||||
noState = !bc.HasState(root) && !bc.stateRecoverable(root)
|
||||
|
||||
start = time.Now() // Timestamp the rewinding is restarted
|
||||
logged = time.Now() // Timestamp last progress log was printed
|
||||
)
|
||||
|
|
@ -723,8 +727,8 @@ func (bc *BlockChain) rewindPathHead(root common.Hash) (*types.Header, uint64) {
|
|||
// If the root threshold hasn't been crossed but the available
|
||||
// state is reached, quickly determine if the target state is
|
||||
// possible to be reached or not.
|
||||
if !beyondRoot && bc.HasState(head.Root) {
|
||||
beyondRoot = !bc.HasState(root) && !bc.stateRecoverable(root)
|
||||
if !beyondRoot && noState && bc.HasState(head.Root) {
|
||||
beyondRoot = true
|
||||
log.Info("Disable the search for unattainable state", "root", root)
|
||||
}
|
||||
// Check if the associated state is available or recoverable if
|
||||
|
|
|
|||
Loading…
Reference in a new issue