示例#1
0
 public ProofOfWorkCalculator(ILogger <ProofOfWorkCalculator> logger,
                              IConsensusParameters consensusParameters,
                              IBlockHeaderRepository blockHeaderRepository)
 {
     _logger = logger;
     _consensusParameters   = consensusParameters;
     _blockHeaderRepository = blockHeaderRepository;
 }
示例#2
0
        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);
        }
 public HeaderMedianTimeCalculator(ILogger <HeaderMedianTimeCalculator> logger, IBlockHeaderRepository blockHeaderRepository)
 {
     _logger = logger;
     _blockHeaderRepository = blockHeaderRepository;
 }