From 2a4edeef059a4eea3200391701093715d50e7194 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Mon, 12 Feb 2024 12:45:48 +0000 Subject: [PATCH] Don't dispose Tasks (unless its waithandle is used) (#6708) --- .../Nethermind.Consensus/Processing/BlockchainProcessor.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Nethermind/Nethermind.Consensus/Processing/BlockchainProcessor.cs b/src/Nethermind/Nethermind.Consensus/Processing/BlockchainProcessor.cs index 936bd0d1ae1..33a673bce4a 100644 --- a/src/Nethermind/Nethermind.Consensus/Processing/BlockchainProcessor.cs +++ b/src/Nethermind/Nethermind.Consensus/Processing/BlockchainProcessor.cs @@ -24,7 +24,7 @@ namespace Nethermind.Consensus.Processing; -public class BlockchainProcessor : IBlockchainProcessor, IBlockProcessingQueue +public sealed class BlockchainProcessor : IBlockchainProcessor, IBlockProcessingQueue { public int SoftMaxRecoveryQueueSizeInTx = 10000; // adjust based on tx or gas public const int MaxProcessingQueueSize = 2000; // adjust based on tx or gas @@ -749,8 +749,6 @@ public void Dispose() _recoveryQueue.Dispose(); _blockQueue.Dispose(); _loopCancellationSource?.Dispose(); - _recoveryTask?.Dispose(); - _processorTask?.Dispose(); _blockTree.NewBestSuggestedBlock -= OnNewBestBlock; _blockTree.NewHeadBlock -= OnNewHeadBlock; }