mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/era: don't let defers stack
This commit is contained in:
parent
6c4747fe60
commit
97b86f45ca
1 changed files with 34 additions and 27 deletions
|
|
@ -220,6 +220,8 @@ func verify(ctx *cli.Context) error {
|
|||
|
||||
// Verify each epoch matches the expected root.
|
||||
for i, want := range roots {
|
||||
// Wrap in function so defers don't stack.
|
||||
err := func() error {
|
||||
name := entries[i]
|
||||
f, err := os.Open(path.Join(dir, name))
|
||||
if err != nil {
|
||||
|
|
@ -249,6 +251,11 @@ func verify(ctx *cli.Context) error {
|
|||
fmt.Printf("Verifying Era1 files \t\t verified=%d,\t elapsed=%s\n", i, common.PrettyDuration(time.Since(start)))
|
||||
reported = time.Now()
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue