Unverified Commit 1affc1c0 authored by Felix Lange's avatar Felix Lange Committed by GitHub

core/txpool: remove use of errors.Join function (#27523)

his function was added in Go 1.20, but our compatibility target
is Go 1.19.
parent 154b016b
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
package txpool package txpool
import ( import (
"errors" "fmt"
"math/big" "math/big"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -88,13 +88,20 @@ func (p *TxPool) Close() error { ...@@ -88,13 +88,20 @@ func (p *TxPool) Close() error {
// Terminate the reset loop and wait for it to finish // Terminate the reset loop and wait for it to finish
errc := make(chan error) errc := make(chan error)
p.quit <- errc p.quit <- errc
errs = append(errs, <-errc) if err := <-errc; err != nil {
errs = append(errs, err)
}
// Terminate each subpool // Terminate each subpool
for _, subpool := range p.subpools { for _, subpool := range p.subpools {
errs = append(errs, subpool.Close()) if err := subpool.Close(); err != nil {
errs = append(errs, err)
}
} }
return errors.Join(errs...) if len(errs) > 0 {
return fmt.Errorf("subpool close errors: %v", errs)
}
return nil
} }
// loop is the transaction pool's main event loop, waiting for and reacting to // loop is the transaction pool's main event loop, waiting for and reacting to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment