public HeadersRequestWorker(WorkerConfig workerConfig, LocalClient localClient, CoreDaemon coreDaemon)
: base("HeadersRequestWorker", workerConfig.initialNotify, workerConfig.minIdleTime, workerConfig.maxIdleTime)
{
this.localClient = localClient;
this.coreDaemon = coreDaemon;
this.coreStorage = coreDaemon.CoreStorage;
this.headersRequestsByPeer = new ConcurrentDictionary<Peer, DateTimeOffset>();
this.localClient.OnBlockHeaders += HandleBlockHeaders;
this.coreDaemon.OnTargetChainChanged += HandleTargetChainChanged;
this.flushWorker = new WorkerMethod("HeadersRequestWorker.FlushWorker", FlushWorkerMethod, initialNotify: true, minIdleTime: TimeSpan.Zero, maxIdleTime: TimeSpan.MaxValue);
this.flushQueue = new ConcurrentQueue<FlushHeaders>();
}