Skip to content

Commit

Permalink
core: reduce nesting in transaction pool code (ethereum#16980)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvisa authored and kielbarry committed Jul 9, 2018
1 parent 31dc110 commit 1996ff8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1996ff8

Please sign in to comment.