From ee8097e44daf25a28002363563f20ad137d46ec4 Mon Sep 17 00:00:00 2001 From: Juan Palacios Date: Tue, 31 Oct 2023 13:40:23 +1100 Subject: [PATCH] Wrapped in pool.config.PrioritizeLocals() for readbility --- core/txpool/legacypool/legacypool.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index 618e4711c2..88957d6c14 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -152,6 +152,10 @@ var DefaultConfig = Config{ Lifetime: 3 * time.Hour, } +func (config *Config) PrioritizeLocals() bool { + return !config.NoLocals +} + // sanitize checks the provided user configurations and changes anything that's // unreasonable or unworkable. func (config *Config) sanitize() Config { @@ -596,7 +600,7 @@ func (pool *LegacyPool) validateTxBasics(tx *types.Transaction, local bool) erro MaxSize: txMaxSize, MinTip: pool.gasTip.Load(), } - if local && !pool.config.NoLocals { + if local && pool.config.PrioritizeLocals() { opts.MinTip = new(big.Int) } if err := txpool.ValidateTransaction(tx, pool.currentHead.Load(), pool.signer, opts); err != nil {