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

This commit is contained in:
Daniel Liu 2026-01-13 19:21:57 +08:00 committed by GitHub
parent a7ddd8ac03
commit a7050de4f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@
package txpool
import (
"errors"
"fmt"
"maps"
"math/big"
@ -89,13 +89,19 @@ func (p *TxPool) Close() error {
// Terminate the reset loop and wait for it to finish
errc := make(chan error)
p.quit <- errc
errs = append(errs, <-errc)
if err := <-errc; err != nil {
errs = append(errs, err)
}
// Terminate each subpool
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