예제 #1
0
        public Synchronizer(IBlockTree blockTree,
                            IBlockValidator blockValidator,
                            ISealValidator sealValidator,
                            IEthSyncPeerPool peerPool,
                            ISyncConfig syncConfig,
                            INodeDataDownloader nodeDataDownloader,
                            ILogManager logManager)
        {
            _logger             = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _syncConfig         = syncConfig ?? throw new ArgumentNullException(nameof(syncConfig));
            _nodeDataDownloader = nodeDataDownloader ?? throw new ArgumentNullException(nameof(nodeDataDownloader));
            _syncPeerPool       = peerPool ?? throw new ArgumentNullException(nameof(peerPool));
            _blockTree          = blockTree ?? throw new ArgumentNullException(nameof(blockTree));

            SyncProgressResolver syncProgressResolver = new SyncProgressResolver(_blockTree, _nodeDataDownloader, logManager);

            _syncMode = new SyncModeSelector(syncProgressResolver, _syncPeerPool, _syncConfig, logManager);

            // make ctor parameter?
            _blockDownloader = new BlockDownloader(_blockTree, blockValidator, sealValidator, logManager);
        }