From 4a7d95ce8a9fa6e74a926ca76106fe5209d32815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vitor=20Naz=C3=A1rio=20Coelho?= Date: Thu, 27 Jun 2019 14:38:48 -0300 Subject: [PATCH] Adjusting TaskManager FIFOSet init (#876) Adjusting TaskManager FifoSet with the style of ProtocolHandler constructor --- neo/Network/P2P/TaskManager.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/neo/Network/P2P/TaskManager.cs b/neo/Network/P2P/TaskManager.cs index 56f4e12765..cd96547df8 100644 --- a/neo/Network/P2P/TaskManager.cs +++ b/neo/Network/P2P/TaskManager.cs @@ -25,13 +25,7 @@ private class Timer { } private readonly NeoSystem system; private const int MaxConncurrentTasks = 3; - - /// - /// The limit `Blockchain.Singleton.MemPool.Capacity * 2` was the same value used in ProtocolHandler - /// - private static readonly int MaxCachedHashes = Blockchain.Singleton.MemPool.Capacity * 2; - private readonly FIFOSet knownHashes = new FIFOSet(MaxCachedHashes); - + private readonly FIFOSet knownHashes; private readonly Dictionary globalTasks = new Dictionary(); private readonly Dictionary sessions = new Dictionary(); private readonly ICancelable timer = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(TimerInterval, TimerInterval, Context.Self, new Timer(), ActorRefs.NoSender); @@ -42,6 +36,7 @@ private class Timer { } public TaskManager(NeoSystem system) { this.system = system; + this.knownHashes = new FIFOSet(Blockchain.Singleton.MemPool.Capacity * 2); } private void OnHeaderTaskCompleted()