Update core/state/snapshot/snapshot.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
maskpp 2025-11-02 17:12:43 +08:00 committed by GitHub
parent 088c5c7b1b
commit d9cf93f9bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,7 +308,7 @@ func (t *Tree) Snapshots(root common.Hash, limits int, nodisk bool) []Snapshot {
defer t.lock.RUnlock() defer t.lock.RUnlock()
var ret []Snapshot var ret []Snapshot
for layer := t.layers[root]; layer != nil && limits != 0; layer, limits = layer.Parent(), limits-1 { for layer := t.layers[root]; layer != nil && limits > 0; layer, limits = layer.Parent(), limits-1 {
if _, isdisk := layer.(*diskLayer); isdisk && nodisk { if _, isdisk := layer.(*diskLayer); isdisk && nodisk {
break break
} }