From 2ea2fce6b88e805d91057db5429614e530094f2f Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "core/txpool: remove use of errors.Join function (#27523)" This reverts commit f4ea07641a49807c49d3bc40283fbce7c276ffe4. --- core/txpool/txpool.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index 24105babc9..f2c94563bc 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -17,7 +17,7 @@ package txpool import ( - "fmt" + "errors" "math/big" "github.com/ethereum/go-ethereum/common" @@ -88,20 +88,13 @@ func (p *TxPool) Close() error { // Terminate the reset loop and wait for it to finish errc := make(chan error) p.quit <- errc - if err := <-errc; err != nil { - errs = append(errs, err) - } + errs = append(errs, <-errc) // Terminate each subpool for _, subpool := range p.subpools { - if err := subpool.Close(); err != nil { - errs = append(errs, err) - } + errs = append(errs, subpool.Close()) } - if len(errs) > 0 { - return fmt.Errorf("subpool close errors: %v", errs) - } - return nil + return errors.Join(errs...) } // loop is the transaction pool's main event loop, waiting for and reacting to