(template)
| 180 | } |
| 181 | |
| 182 | function newBlockTemplate(template) { |
| 183 | let buffer = new Buffer(template.blocktemplate_blob, 'hex'); |
| 184 | let previous_hash = new Buffer(32); |
| 185 | buffer.copy(previous_hash, 0, 7, 39); |
| 186 | console.log(threadName + 'New block to mine at height: ' + template.height + '. Difficulty: ' + template.difficulty); |
| 187 | if (activeBlockTemplate) { |
| 188 | pastBlockTemplates.enq(activeBlockTemplate); |
| 189 | } |
| 190 | activeBlockTemplate = new BlockTemplate(template); |
| 191 | for (let minerId in activeMiners) { |
| 192 | if (activeMiners.hasOwnProperty(minerId)) { |
| 193 | let miner = activeMiners[minerId]; |
| 194 | debug(threadName + "Updating worker " + miner.payout + " With new work at height: " + template.height); |
| 195 | miner.sendNewJob(); |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | let VarDiff = (function () { |
| 201 | let variance = global.config.pool.varDiffVariance / 100 * global.config.pool.targetTime; |
no outgoing calls
no test coverage detected