Skip to content

Commit

Permalink
Adjusting TaskManager FIFOSet init (neo-project#876)
Browse files Browse the repository at this point in the history
Adjusting TaskManager FifoSet with the style of ProtocolHandler constructor
  • Loading branch information
vncoelho authored and Tommo-L committed Jun 22, 2020
1 parent 41ae0e3 commit 4a7d95c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions neo/Network/P2P/TaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ private class Timer { }

private readonly NeoSystem system;
private const int MaxConncurrentTasks = 3;

/// <summary>
/// The limit `Blockchain.Singleton.MemPool.Capacity * 2` was the same value used in ProtocolHandler
/// </summary>
private static readonly int MaxCachedHashes = Blockchain.Singleton.MemPool.Capacity * 2;
private readonly FIFOSet<UInt256> knownHashes = new FIFOSet<UInt256>(MaxCachedHashes);

private readonly FIFOSet<UInt256> knownHashes;
private readonly Dictionary<UInt256, int> globalTasks = new Dictionary<UInt256, int>();
private readonly Dictionary<IActorRef, TaskSession> sessions = new Dictionary<IActorRef, TaskSession>();
private readonly ICancelable timer = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(TimerInterval, TimerInterval, Context.Self, new Timer(), ActorRefs.NoSender);
Expand All @@ -42,6 +36,7 @@ private class Timer { }
public TaskManager(NeoSystem system)
{
this.system = system;
this.knownHashes = new FIFOSet<UInt256>(Blockchain.Singleton.MemPool.Capacity * 2);
}

private void OnHeaderTaskCompleted()
Expand Down

0 comments on commit 4a7d95c

Please sign in to comment.