Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get globalHashrate() {
const nBits = this.wrappedNode.blockchain.head.header.nBits;
const difficulty = Nimiq.BlockUtils.compactToDifficulty(nBits);
return difficulty * Math.pow(2, 16) / Nimiq.Policy.BLOCK_TIME;
}_onWorkRange(data) {
Log.i(Miner, `receive workRange ${data[P.WorkRange_256]} Difficult ${data[P.WorkRange_Difficult]}`)
this._workrange4096 = data[P.WorkRange_256] / 16;
this._workrange4096pullThreshold = Math.round(this._workrange4096 / 2);
this._compact = Nimiq.BlockUtils.difficultyToCompact(new BigNumber(data[P.WorkRange_Difficult]));
}