From 2edc252993c8f5e080a1ca8eead65c96b3c1292b Mon Sep 17 00:00:00 2001 From: Newt Date: Fri, 12 Apr 2024 01:19:22 +0800 Subject: [PATCH] core: use range loop for subpool iteration --- core/txpool/txpool.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index be7435247d..4a30f4f63e 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -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