Skip to content

Commit 54f89a6

Browse files
ucwongDoozers
authored andcommitted
core/txpool : small cleanup refactors (ethereum#28654)
1 parent eef6ce7 commit 54f89a6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

cmd/geth/logging_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ package main
2121
import (
2222
"bufio"
2323
"bytes"
24+
"encoding/json"
2425
"fmt"
2526
"io"
2627
"math/rand"
2728
"os"
2829
"os/exec"
2930
"strings"
3031
"testing"
31-
"encoding/json"
3232

3333
"github.com/ethereum/go-ethereum/internal/reexec"
3434
)

core/txpool/legacypool/legacypool.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,7 @@ func (pool *LegacyPool) addLocals(txs []*types.Transaction) []error {
923923
// addLocal enqueues a single local transaction into the pool if it is valid. This is
924924
// a convenience wrapper around addLocals.
925925
func (pool *LegacyPool) addLocal(tx *types.Transaction) error {
926-
errs := pool.addLocals([]*types.Transaction{tx})
927-
return errs[0]
926+
return pool.addLocals([]*types.Transaction{tx})[0]
928927
}
929928

930929
// addRemotes enqueues a batch of transactions into the pool if they are valid. If the
@@ -939,8 +938,7 @@ func (pool *LegacyPool) addRemotes(txs []*types.Transaction) []error {
939938
// addRemote enqueues a single transaction into the pool if it is valid. This is a convenience
940939
// wrapper around addRemotes.
941940
func (pool *LegacyPool) addRemote(tx *types.Transaction) error {
942-
errs := pool.addRemotes([]*types.Transaction{tx})
943-
return errs[0]
941+
return pool.addRemotes([]*types.Transaction{tx})[0]
944942
}
945943

946944
// addRemotesSync is like addRemotes, but waits for pool reorganization. Tests use this method.

0 commit comments

Comments
 (0)