From d367576093135d2f21007ff1c8f8447bb17e06c9 Mon Sep 17 00:00:00 2001 From: MozirDmitriy Date: Mon, 22 Sep 2025 10:09:57 +0300 Subject: [PATCH] cmd/era: fix iterator error source handling in checkAccumulator --- cmd/era/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/era/main.go b/cmd/era/main.go index 8b57fd695c..893db3787a 100644 --- a/cmd/era/main.go +++ b/cmd/era/main.go @@ -273,11 +273,11 @@ func checkAccumulator(e *era.Era) error { // accumulation across the entire set and are verified at the end. for it.Next() { // 1) next() walks the block index, so we're able to implicitly verify it. - if it.Error() != nil { - return fmt.Errorf("error reading block %d: %w", it.Number(), err) + if itErr := it.Error(); itErr != nil { + return fmt.Errorf("error reading block %d: %w", it.Number(), itErr) } block, receipts, err := it.BlockAndReceipts() - if it.Error() != nil { + if err != nil { return fmt.Errorf("error reading block %d: %w", it.Number(), err) } // 2) recompute tx root and verify against header.