예제 #1
0
파일: Program.cs 프로젝트: MaxDZ8/fastdee
        static Stratum.Connector InstantiateConnector(string algorithm, double?diffmul, ulong?n2off = null)
        {
            var initialMerkle = ChooseMerkleGenerator(algorithm);

            if (null == initialMerkle)
            {
                throw new BadInitializationException($"Unsupported algorithm: {algorithm}");
            }
            var factors = ChooseDifficulties(algorithm, diffmul);
            var difficultyCalculator = new LockingCurrentDifficulty(ChooseDiffMaker(algorithm, factors));
            var headerGen            = new Stratum.HeaderGenerator(initialMerkle);

            if (n2off.HasValue)
            {
                headerGen.NextNonce(n2off.Value);
            }
            return(new Stratum.Connector(headerGen, difficultyCalculator));
        }
예제 #2
0
파일: Connector.cs 프로젝트: MaxDZ8/fastdee
 internal Connector(HeaderGenerator headerMaker, IDifficultyCalculation diffCalc)
 {
     careful = new Delicate(headerMaker, diffCalc);
 }
예제 #3
0
파일: Connector.cs 프로젝트: MaxDZ8/fastdee
 public Delicate(HeaderGenerator headerGenerator, IDifficultyCalculation diffCalc)
 {
     this.headerGenerator = headerGenerator;
     this.diffCalc        = diffCalc;
 }