public IPeerAllocationStrategy Create(BlocksRequest request)
        {
            IPeerAllocationStrategy baseStrategy      = new BlocksSyncPeerAllocationStrategy(request.NumberOfLatestBlocksToBeIgnored);
            TotalDiffStrategy       totalDiffStrategy = new TotalDiffStrategy(baseStrategy);

            return(totalDiffStrategy);
        }
コード例 #2
0
        public IPeerAllocationStrategy Create(BlocksRequest?request)
        {
            // because of the way the generics cannot handle T / T?
            if (request == null)
            {
                throw new ArgumentNullException(
                          $"NULL received for allocation in {nameof(BlocksSyncPeerAllocationStrategyFactory)}");
            }

            IPeerAllocationStrategy baseStrategy      = new BlocksSyncPeerAllocationStrategy(request.NumberOfLatestBlocksToBeIgnored);
            TotalDiffStrategy       totalDiffStrategy = new TotalDiffStrategy(baseStrategy);

            return(totalDiffStrategy);
        }