Skip to content

Commit 2ea2fce

Browse files
authored
Revert "core/txpool: remove use of errors.Join function (ethereum#27523)"
This reverts commit f4ea076.
1 parent 51b8c3f commit 2ea2fce

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

core/txpool/txpool.go

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

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

2323
"github.com/ethereum/go-ethereum/common"
@@ -88,20 +88,13 @@ func (p *TxPool) Close() error {
8888
// Terminate the reset loop and wait for it to finish
8989
errc := make(chan error)
9090
p.quit <- errc
91-
if err := <-errc; err != nil {
92-
errs = append(errs, err)
93-
}
91+
errs = append(errs, <-errc)
9492

9593
// Terminate each subpool
9694
for _, subpool := range p.subpools {
97-
if err := subpool.Close(); err != nil {
98-
errs = append(errs, err)
99-
}
95+
errs = append(errs, subpool.Close())
10096
}
101-
if len(errs) > 0 {
102-
return fmt.Errorf("subpool close errors: %v", errs)
103-
}
104-
return nil
97+
return errors.Join(errs...)
10598
}
10699

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

0 commit comments

Comments
 (0)