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