mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-15 23:38:19 +00:00
Fix pool giving too many entries (#488)
This commit is contained in:
parent
6cad65e62b
commit
dba877998b
@ -611,7 +611,8 @@ func (p *TxPool) Best(n uint16, txs *types.TxsRlp, tx kv.Tx) error {
|
|||||||
txs.Resize(uint(cmp.Min(int(n), len(p.pending.best.ms))))
|
txs.Resize(uint(cmp.Min(int(n), len(p.pending.best.ms))))
|
||||||
|
|
||||||
best := p.pending.best
|
best := p.pending.best
|
||||||
for i, j := 0, 0; j < int(n) && i < len(best.ms); i++ {
|
j := 0
|
||||||
|
for i := 0; j < int(n) && i < len(best.ms); i++ {
|
||||||
if best.ms[i].Tx.Gas >= p.blockGasLimit.Load() {
|
if best.ms[i].Tx.Gas >= p.blockGasLimit.Load() {
|
||||||
// Skip transactions with very large gas limit
|
// Skip transactions with very large gas limit
|
||||||
continue
|
continue
|
||||||
@ -628,6 +629,7 @@ func (p *TxPool) Best(n uint16, txs *types.TxsRlp, tx kv.Tx) error {
|
|||||||
txs.IsLocal[j] = isLocal
|
txs.IsLocal[j] = isLocal
|
||||||
j++
|
j++
|
||||||
}
|
}
|
||||||
|
txs.Resize(uint(j))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user