From f5e2d16f50405e4ded8686a7deee8237d8150525 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Tue, 10 Mar 2026 21:18:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor=E2=80=8C(core/txpool/legacypool):=20ti?= =?UTF-8?q?ny=20#28654=20(#2131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/txpool/legacypool/legacypool.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index 1d6ee54ec1..224f6159a9 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -1108,8 +1108,7 @@ func (pool *LegacyPool) addLocals(txs []*types.Transaction) []error { // AddLocal enqueues a single local transaction into the pool if it is valid. This is // a convenience wrapper around AddLocals. func (pool *LegacyPool) addLocal(tx *types.Transaction) error { - errs := pool.addLocals([]*types.Transaction{tx}) - return errs[0] + return pool.addLocals([]*types.Transaction{tx})[0] } // AddRemotes enqueues a batch of transactions into the pool if they are valid. If the @@ -1124,8 +1123,7 @@ func (pool *LegacyPool) AddRemotes(txs []*types.Transaction) []error { // addRemote enqueues a single transaction into the pool if it is valid. This is a convenience // wrapper around AddRemotes. func (pool *LegacyPool) addRemote(tx *types.Transaction) error { - errs := pool.AddRemotes([]*types.Transaction{tx}) - return errs[0] + return pool.AddRemotes([]*types.Transaction{tx})[0] } // AddRemotesSync is like AddRemotes, but waits for pool reorganization. Tests use this method.