public HandshakeProcessor(ILogger <HandshakeProcessor> logger,
                           IEventBus eventBus,
                           IDateTimeProvider dateTimeProvider,
                           IRandomNumberGenerator randomNumberGenerator,
                           NodeImplementation nodeImplementation,
                           IPeerBehaviorManager peerBehaviorManager,
                           IInitialBlockDownloadTracker initialBlockDownloadState,
                           IUserAgentBuilder userAgentBuilder,
                           ILocalServiceProvider localServiceProvider,
                           IHeadersTree headersTree,
                           SelfConnectionTracker selfConnectionTracker) : base(logger,
                                                                               eventBus,
                                                                               peerBehaviorManager,
                                                                               isHandshakeAware: true,
                                                                               // we are performing handshake so we want to receive messages before handshake status
                                                                               receiveMessagesOnlyIfHandshaked: false)
 {
     _dateTimeProvider          = dateTimeProvider;
     _randomNumberGenerator     = randomNumberGenerator;
     _nodeImplementation        = nodeImplementation;
     _initialBlockDownloadState = initialBlockDownloadState;
     _userAgentBuilder          = userAgentBuilder;
     _localServiceProvider      = localServiceProvider;
     _headersTree           = headersTree;
     _selfConnectionTracker = selfConnectionTracker;
     _status = new HandshakeProcessorStatus(this);
 }
        public ChainState(ILogger <ChainState> logger,
                          IHeadersTree headersTree,
                          ICoinsView coinsView,
                          IBlockHeaderRepository blockHeaderRepository,
                          IConsensusParameters consensusParameters)
        {
            this.logger            = logger;
            HeadersTree            = headersTree;
            this.coinsView         = coinsView;
            _blockHeaderRepository = blockHeaderRepository;
            _consensusParameters   = consensusParameters;
            ChainTip   = headersTree.Genesis;
            BestHeader = headersTree.Genesis;

            _blockHeaderRepository.TryAdd(consensusParameters.GenesisHeader);
        }