Skip to content

Commit 91bf667

Browse files
authored
Revert "core/state/pruner: remove unused error-return (ethereum#27273)"
This reverts commit b373df4.
1 parent 7d43551 commit 91bf667

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/state/pruner/bloom.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ func (bloom *stateBloom) Delete(key []byte) error { panic("not supported") }
127127
// reports whether the key is contained.
128128
// - If it says yes, the key may be contained
129129
// - If it says no, the key is definitely not contained.
130-
func (bloom *stateBloom) Contain(key []byte) bool {
131-
return bloom.bloom.Contains(stateBloomHasher(key))
130+
func (bloom *stateBloom) Contain(key []byte) (bool, error) {
131+
return bloom.bloom.Contains(stateBloomHasher(key)), nil
132132
}

core/state/pruner/pruner.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ func prune(snaptree *snapshot.Tree, root common.Hash, maindb ethdb.Database, sta
146146
if _, exist := middleStateRoots[common.BytesToHash(checkKey)]; exist {
147147
log.Debug("Forcibly delete the middle state roots", "hash", common.BytesToHash(checkKey))
148148
} else {
149-
if stateBloom.Contain(checkKey) {
149+
if ok, err := stateBloom.Contain(checkKey); err != nil {
150+
return err
151+
} else if ok {
150152
continue
151153
}
152154
}

0 commit comments

Comments
 (0)