Exemple #1
0
        public BlockDownloader(IBlockTree blockTree, IBlockValidator blockValidator, ISealValidator sealValidator, ILogManager logManager)
        {
            _blockTree      = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _blockValidator = blockValidator ?? throw new ArgumentNullException(nameof(blockValidator));
            _sealValidator  = sealValidator ?? throw new ArgumentNullException(nameof(sealValidator));
            _logger         = logManager.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));

            _syncBatchSize = new SyncBatchSize(logManager);
            _syncStats     = new SyncStats("Blocks", logManager);
        }
Exemple #2
0
        public BlockDownloader(IBlockTree blockTree,
                               IBlockValidator blockValidator,
                               ISealValidator sealValidator,
                               ISyncReport syncReport,
                               IReceiptStorage receiptStorage,
                               ISpecProvider specProvider,
                               ILogManager logManager)
        {
            _blockTree      = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _blockValidator = blockValidator ?? throw new ArgumentNullException(nameof(blockValidator));
            _sealValidator  = sealValidator ?? throw new ArgumentNullException(nameof(sealValidator));
            _syncReport     = syncReport ?? throw new ArgumentNullException(nameof(syncReport));
            _receiptStorage = receiptStorage ?? throw new ArgumentNullException(nameof(receiptStorage));
            _specProvider   = specProvider ?? throw new ArgumentNullException(nameof(specProvider));
            _logger         = logManager.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));

            _syncBatchSize = new SyncBatchSize(logManager);
        }