static Stratum.Notification.NewJob MakeJob(ReplicationData.Job repl) { var jobid = "abcd"; var cbHead = HexHelp.DecodeHex(repl.cbHead); var cbTail = HexHelp.DecodeHex(repl.cbTail); var parsedMerkle = DecodeMerkles(repl.merkles); var bver = HexHelp.DecodeHex(repl.blockVersion); var ndiff = HexHelp.DecodeHex(repl.networkDiff); var ntime = HexHelp.DecodeHex(repl.networkTime); var res = new Stratum.Notification.NewJob(jobid, bver, null, cbHead, cbTail, ndiff, ntime, true); HexHelp.DecodeInto(res.prevBlock.blob, repl.prevHash); res.merkles.AddRange(parsedMerkle); return(res); }
static List <Mining.Merkle> DecodeMerkles(string[]?merkles) { var res = new List <Mining.Merkle>(); if (null == merkles) { return(res); } for (var loop = 0; loop < merkles.Length; loop++) { var gen = new Mining.Merkle(); HexHelp.DecodeInto(gen.blob, merkles[loop]); res.Add(gen); } return(res); }