aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWenbiao Zheng <delweng@gmail.com>2018-06-14 18:46:43 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-06-14 18:46:43 +0800
commit52b1d0945774336a1c2164f873df3c0a72cacaee (patch)
tree8285c21f6acfa29d339a204b33e097892d5e8e2c /core
parent9402f965977620de0dcd968ad6943f66a80bcc5d (diff)
downloadgo-tangerine-52b1d0945774336a1c2164f873df3c0a72cacaee.tar
go-tangerine-52b1d0945774336a1c2164f873df3c0a72cacaee.tar.gz
go-tangerine-52b1d0945774336a1c2164f873df3c0a72cacaee.tar.bz2
go-tangerine-52b1d0945774336a1c2164f873df3c0a72cacaee.tar.lz
go-tangerine-52b1d0945774336a1c2164f873df3c0a72cacaee.tar.xz
go-tangerine-52b1d0945774336a1c2164f873df3c0a72cacaee.tar.zst
go-tangerine-52b1d0945774336a1c2164f873df3c0a72cacaee.zip
core: reduce nesting in transaction pool code (#16980)
Diffstat (limited to 'core')
-rw-r--r--core/tx_pool.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/tx_pool.go b/core/tx_pool.go
index b0b55fcc2..9c958e3b6 100644
--- a/core/tx_pool.go
+++ b/core/tx_pool.go
@@ -815,11 +815,9 @@ func (pool *TxPool) addTxsLocked(txs []*types.Transaction, local bool) []error {
for i, tx := range txs {
var replace bool
- if replace, errs[i] = pool.add(tx, local); errs[i] == nil {
- if !replace {
- from, _ := types.Sender(pool.signer, tx) // already validated
- dirty[from] = struct{}{}
- }
+ if replace, errs[i] = pool.add(tx, local); errs[i] == nil && !replace {
+ from, _ := types.Sender(pool.signer, tx) // already validated
+ dirty[from] = struct{}{}
}
}
// Only reprocess the internal state if something was actually added