core: use range loop for subpool iteration

This commit is contained in:
Newt 2024-04-12 01:19:22 +08:00
parent 86116f78fc
commit 2edc252993

View file

@ -334,9 +334,9 @@ func (p *TxPool) Add(txs []*types.Transaction, local bool, sync bool) []error {
// Add the transactions split apart to the individual subpools and piece
// back the errors into the original sort order.
errsets := make([][]error, len(p.subpools))
for i := 0; i < len(p.subpools); i++ {
errsets[i] = p.subpools[i].Add(txsets[i], local, sync)
}
for i, subpool := range p.subpools {
errsets[i] = subpool.Add(txsets[i], local, sync)
}
errs := make([]error, len(txs))
for i, split := range splits {
// If the transaction was rejected by all subpools, mark it unsupported