[FIX] Devision by 0 on missing nethashrate
This commit is contained in:
parent
09b303fa49
commit
7a87c09056
@ -47,7 +47,11 @@ class CoinBase extends Base {
|
|||||||
* Calculate our networks expected time per block
|
* Calculate our networks expected time per block
|
||||||
**/
|
**/
|
||||||
public function calcNetworkExpectedTimePerBlock($dDifficulty, $dNetworkHashrate) {
|
public function calcNetworkExpectedTimePerBlock($dDifficulty, $dNetworkHashrate) {
|
||||||
return pow(2, 32) * $dDifficulty / $dNetworkHashrate;
|
if ($dNetworkHashrate > 0) {
|
||||||
|
return pow(2, 32) * $dDifficulty / $dNetworkHashrate;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Calculate next expected difficulty based on current difficulty
|
* Calculate next expected difficulty based on current difficulty
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user