Beispiel #1
0
        public CliqueBlockProducer(
            ITransactionPool transactionPool,
            IBlockchainProcessor devProcessor,
            IBlockTree blockTree,
            IStateProvider stateProvider,
            ITimestamp timestamp,
            ICryptoRandom cryptoRandom,
            CliqueSealEngine cliqueSealEngine,
            CliqueConfig config,
            Address address,
            ILogManager logManager)
        {
            _logger          = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager));
            _transactionPool = transactionPool ?? throw new ArgumentNullException(nameof(transactionPool));
            _processor       = devProcessor ?? throw new ArgumentNullException(nameof(devProcessor));
            _blockTree       = blockTree ?? throw new ArgumentNullException(nameof(blockTree));
            _stateProvider   = stateProvider ?? throw new ArgumentNullException(nameof(stateProvider));
            _timestamp       = timestamp ?? throw new ArgumentNullException(nameof(_timestamp));
            _cryptoRandom    = cryptoRandom ?? throw new ArgumentNullException(nameof(_cryptoRandom));
            _sealEngine      = cliqueSealEngine ?? throw new ArgumentNullException(nameof(_sealEngine));
            _config          = config ?? throw new ArgumentNullException(nameof(_config));
            _address         = address ?? throw new ArgumentNullException(nameof(_address));

            if (_sealEngine.CanSeal)
            {
                _timer.AutoReset = false;
                _timer.Elapsed  += TimerOnElapsed;
                _timer.Interval  = 100;
                _timer.Start();
            }
        }
Beispiel #2
0
 public AuthorRecoveryStep(CliqueSealEngine clique)
 {
     _clique = clique;
 }