mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
28125: check config.NoLocals on legacypool's validateTxBasics
This commit is contained in:
parent
bffa606f63
commit
d5848e3af9
2 changed files with 8 additions and 2 deletions
|
|
@ -596,7 +596,7 @@ func (pool *LegacyPool) validateTxBasics(tx *types.Transaction, local bool) erro
|
|||
MaxSize: txMaxSize,
|
||||
MinTip: pool.gasTip.Load(),
|
||||
}
|
||||
if local {
|
||||
if local && !pool.config.NoLocals {
|
||||
opts.MinTip = new(big.Int)
|
||||
}
|
||||
if err := txpool.ValidateTransaction(tx, pool.currentHead.Load(), pool.signer, opts); err != nil {
|
||||
|
|
|
|||
|
|
@ -1496,7 +1496,13 @@ func TestMinGasPriceEnforced(t *testing.T) {
|
|||
t.Parallel()
|
||||
|
||||
// Create the pool to test the pricing enforcement with
|
||||
pool, _ := setupPoolWithConfig(eip1559Config)
|
||||
statedb, _ := state.New(types.EmptyRootHash, state.NewDatabase(rawdb.NewMemoryDatabase()), nil)
|
||||
blockchain := newTestBlockChain(eip1559Config, 10000000, statedb, new(event.Feed))
|
||||
|
||||
txPoolConfig := DefaultConfig
|
||||
txPoolConfig.NoLocals = true
|
||||
pool := New(txPoolConfig, blockchain)
|
||||
pool.Init(new(big.Int).SetUint64(txPoolConfig.PriceLimit), blockchain.CurrentBlock(), makeAddressReserver())
|
||||
defer pool.Close()
|
||||
|
||||
key, _ := crypto.GenerateKey()
|
||||
|
|
|
|||
Loading…
Reference in a new issue