/// <summary>Public constructor for unit testing</summary> public BlockStoreLoop(IAsyncLoopFactory asyncLoopFactory, StoreBlockPuller blockPuller, IBlockRepository blockRepository, IBlockStoreCache cache, ConcurrentChain chain, ChainState chainState, StoreSettings storeSettings, INodeLifetime nodeLifetime, ILoggerFactory loggerFactory, IDateTimeProvider dateTimeProvider) { this.asyncLoopFactory = asyncLoopFactory; this.BlockPuller = blockPuller; this.BlockRepository = blockRepository; this.Chain = chain; this.ChainState = chainState; this.nodeLifetime = nodeLifetime; this.storeSettings = storeSettings; this.logger = loggerFactory.CreateLogger(GetType().FullName); this.loggerFactory = loggerFactory; this.dateTimeProvider = dateTimeProvider; this.PendingStorage = new ConcurrentDictionary <uint256, BlockPair>(); this.blockStoreStats = new BlockStoreStats(this.BlockRepository, cache, this.dateTimeProvider, this.logger); }
/// <summary> /// Public constructor for unit testing /// </summary> public BlockStoreLoop(IAsyncLoopFactory asyncLoopFactory, StoreBlockPuller blockPuller, BlockRepository blockRepository, BlockStoreCache cache, ConcurrentChain chain, ChainState chainState, NodeSettings nodeArgs, INodeLifetime nodeLifetime, ILoggerFactory loggerFactory, string name = "BlockStore") { this.name = name; this.asyncLoopFactory = asyncLoopFactory; this.BlockPuller = blockPuller; this.BlockRepository = blockRepository; this.Chain = chain; this.ChainState = chainState; this.blockStoreCache = cache; this.nodeLifetime = nodeLifetime; this.nodeArgs = nodeArgs; this.storeLogger = loggerFactory.CreateLogger(GetType().FullName); this.PendingStorage = new ConcurrentDictionary <uint256, BlockPair>(); this.blockStoreStats = new BlockStoreStats(this.BlockRepository, this.blockStoreCache, this.storeLogger); }