diff --git a/src/Nethermind/Nethermind.TxPool/Collections/BlobTxDistinctSortedPool.cs b/src/Nethermind/Nethermind.TxPool/Collections/BlobTxDistinctSortedPool.cs index 9f814668b0e..e924b9e5733 100644 --- a/src/Nethermind/Nethermind.TxPool/Collections/BlobTxDistinctSortedPool.cs +++ b/src/Nethermind/Nethermind.TxPool/Collections/BlobTxDistinctSortedPool.cs @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited // SPDX-License-Identifier: LGPL-3.0-only -using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; @@ -65,7 +64,7 @@ protected override bool InsertCore(ValueHash256 key, Transaction value, AddressA return false; } - protected void AddToBlobIndex(Transaction blobTx) + private void AddToBlobIndex(Transaction blobTx) { if (blobTx.BlobVersionedHashes?.Length > 0) { diff --git a/src/Nethermind/Nethermind.TxPool/Collections/PersistentBlobTxDistinctSortedPool.cs b/src/Nethermind/Nethermind.TxPool/Collections/PersistentBlobTxDistinctSortedPool.cs index 26e3d7ad826..f17b0f51866 100644 --- a/src/Nethermind/Nethermind.TxPool/Collections/PersistentBlobTxDistinctSortedPool.cs +++ b/src/Nethermind/Nethermind.TxPool/Collections/PersistentBlobTxDistinctSortedPool.cs @@ -36,9 +36,9 @@ private void RecreateLightTxCollectionAndCache(ITxStorage blobTxStorage) long startTime = Stopwatch.GetTimestamp(); foreach (LightTransaction lightBlobTx in blobTxStorage.GetAll()) { - if (base.TryInsert(lightBlobTx.Hash, lightBlobTx, out _)) + if (lightBlobTx.SenderAddress is not null + && base.InsertCore(lightBlobTx.Hash, lightBlobTx, lightBlobTx.SenderAddress)) { - AddToBlobIndex(lightBlobTx); numberOfTxsInDb++; numberOfBlobsInDb += lightBlobTx.BlobVersionedHashes?.Length ?? 0; } diff --git a/src/Nethermind/Nethermind.TxPool/Collections/SortedPool.cs b/src/Nethermind/Nethermind.TxPool/Collections/SortedPool.cs index c8db34851c7..f5ebedda4d4 100644 --- a/src/Nethermind/Nethermind.TxPool/Collections/SortedPool.cs +++ b/src/Nethermind/Nethermind.TxPool/Collections/SortedPool.cs @@ -352,7 +352,7 @@ public bool TryGetValue(TKey key, [NotNullWhen(true)] out TValue? value) /// Element to insert. /// Element removed because of exceeding capacity /// If element was inserted. False if element was already present in pool. - public virtual bool TryInsert(TKey key, TValue value, out TValue? removed) + public bool TryInsert(TKey key, TValue value, out TValue? removed) { using var lockRelease = Lock.Acquire();