Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 internal Connector(HeaderGenerator headerMaker, IDifficultyCalculation diffCalc)
 {
     careful = new Delicate(headerMaker, diffCalc);
 }
Ejemplo n.º 3
0
 public Delicate(HeaderGenerator headerGenerator, IDifficultyCalculation diffCalc)
 {
     this.headerGenerator = headerGenerator;
     this.diffCalc        = diffCalc;
 }