From 2f2959d00399c80ef3771729a0c37897451166da Mon Sep 17 00:00:00 2001 From: John Chase <68833933+joohhnnn@users.noreply.github.com> Date: Wed, 17 May 2023 16:23:06 +0800 Subject: [PATCH] core/state/pruner: remove unused error-return (#27273) --- core/state/pruner/bloom.go | 4 ++-- core/state/pruner/pruner.go | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/state/pruner/bloom.go b/core/state/pruner/bloom.go index 72315db72..9f068eaf2 100644 --- a/core/state/pruner/bloom.go +++ b/core/state/pruner/bloom.go @@ -127,6 +127,6 @@ func (bloom *stateBloom) Delete(key []byte) error { panic("not supported") } // reports whether the key is contained. // - If it says yes, the key may be contained // - If it says no, the key is definitely not contained. -func (bloom *stateBloom) Contain(key []byte) (bool, error) { - return bloom.bloom.Contains(stateBloomHasher(key)), nil +func (bloom *stateBloom) Contain(key []byte) bool { + return bloom.bloom.Contains(stateBloomHasher(key)) } diff --git a/core/state/pruner/pruner.go b/core/state/pruner/pruner.go index 2bd5658e0..a8142c51f 100644 --- a/core/state/pruner/pruner.go +++ b/core/state/pruner/pruner.go @@ -146,9 +146,7 @@ func prune(snaptree *snapshot.Tree, root common.Hash, maindb ethdb.Database, sta if _, exist := middleStateRoots[common.BytesToHash(checkKey)]; exist { log.Debug("Forcibly delete the middle state roots", "hash", common.BytesToHash(checkKey)) } else { - if ok, err := stateBloom.Contain(checkKey); err != nil { - return err - } else if ok { + if stateBloom.Contain(checkKey) { continue } }