From 3e3c56b235b7a9537dc5f66c1e1fdf7865242533 Mon Sep 17 00:00:00 2001 From: emailtovamos Date: Thu, 19 Sep 2024 04:32:47 +0100 Subject: [PATCH] pool: address minor issues --- core/txpool/legacypool/legacypool.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index 85c84b758..3b8d2b46e 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -270,7 +270,6 @@ type txpoolResetRequest struct { func New(config Config, chain BlockChain) *LegacyPool { // Sanitize the input to ensure no vulnerable gas prices are set config = (&config).sanitize() - maxPool3Size := config.Pool3Slots // Create the transaction pool with its initial settings pool := &LegacyPool{ @@ -288,7 +287,7 @@ func New(config Config, chain BlockChain) *LegacyPool { reorgDoneCh: make(chan chan struct{}), reorgShutdownCh: make(chan struct{}), initDoneCh: make(chan struct{}), - localBufferPool: NewLRUBufferFastCache(int(maxPool3Size)), + localBufferPool: NewLRUBufferFastCache(int(config.Pool3Slots)), } pool.locals = newAccountSet(pool.signer) for _, addr := range config.Locals { @@ -993,8 +992,9 @@ func (pool *LegacyPool) addToPool12OrPool3(tx *types.Transaction, from common.Ad pool.localBufferPool.Add(tx) log.Debug("adding to pool3", "transaction", tx.Hash().String()) return true, nil + } else { + return false, errors.New("could not add to any pool") } - return false, errors.New("could not add to any pool") } // isGapped reports whether the given transaction is immediately executable.