mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
simplify path layerTree logic
This commit is contained in:
parent
f3c389052e
commit
691291b42b
1 changed files with 2 additions and 2 deletions
|
|
@ -186,8 +186,8 @@ func (tree *layerTree) cap(root common.Hash, layers int) error {
|
|||
delete(children, root)
|
||||
}
|
||||
// diskLayer only has one and is the bottom layer.
|
||||
if dl := tree.bottom(); dl.isStale() {
|
||||
remove(root)
|
||||
if dl := tree.bottom(); dl != nil && dl.isStale() {
|
||||
remove(dl.root)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue