Wrapped in pool.config.PrioritizeLocals() for readbility

This commit is contained in:
Juan Palacios 2023-10-31 13:40:23 +11:00
parent d5848e3af9
commit ee8097e44d
No known key found for this signature in database
GPG key ID: 9CEE762FFEF26E1C

View file

@ -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 {