File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1717package txpool
1818
1919import (
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
You can’t perform that action at this time.
0 commit comments