Skip to content

Commit 051aee9

Browse files
committed
core/txpool: remove use of errors.Join function ethereum#27523
1 parent 44771b7 commit 051aee9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

core/txpool/txpool.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package txpool
1818

1919
import (
20-
"errors"
20+
"fmt"
2121
"maps"
2222
"math/big"
2323

@@ -89,13 +89,19 @@ func (p *TxPool) Close() error {
8989
// Terminate the reset loop and wait for it to finish
9090
errc := make(chan error)
9191
p.quit <- errc
92-
errs = append(errs, <-errc)
93-
92+
if err := <-errc; err != nil {
93+
errs = append(errs, err)
94+
}
9495
// Terminate each subpool
9596
for _, subpool := range p.subpools {
96-
errs = append(errs, subpool.Close())
97+
if err := subpool.Close(); err != nil {
98+
errs = append(errs, err)
99+
}
97100
}
98-
return errors.Join(errs...)
101+
if len(errs) > 0 {
102+
return fmt.Errorf("subpool close errors: %v", errs)
103+
}
104+
return nil
99105
}
100106

101107
// loop is the transaction pool's main event loop, waiting for and reacting to

0 commit comments

Comments
 (0)