core: reduce nesting in transaction pool code (#16980)

pull/16983/head
Wenbiao Zheng 6 years ago committed by Péter Szilágyi
parent 9402f96597
commit 52b1d09457
  1. 4
      core/tx_pool.go

@ -815,13 +815,11 @@ 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 {
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
if len(dirty) > 0 {
addrs := make([]common.Address, 0, len(dirty))

Loading…
Cancel
Save