target_bits) / $interval / 1000; } /** * Calculate estimated shares of this coin, this is using baseline * according to our configuration difficulty **/ public function calcEstaimtedShares($dDifficulty) { return (int)round((pow(2, (32 - $this->target_bits)) * $dDifficulty) / pow(2, ($this->config['difficulty'] - 16))); } /** * Calculate our networks expected time per block **/ public function calcNetworkExpectedTimePerBlock($dDifficulty, $dNetworkHashrate) { return pow(2, 32) * $dDifficulty / $dNetworkHashrate; } /** * Calculate next expected difficulty based on current difficulty **/ public function calcExpectedNextDifficulty($dDifficulty, $dNetworkHashrate) { return round($dDifficulty * $this->config['cointarget'] / $this->calcNetworkExpectedTimePerBlock($dDifficulty, $dNetworkHashrate), 8); } } ?>