backend: ignore btc net hash overflow #141

could be due to the unit for the network_hash.. quick fix
This commit is contained in:
Tanguy Pruvot 2017-07-17 06:19:40 +02:00
parent 41afa22d0d
commit 17875d358f

View file

@ -278,9 +278,13 @@ function BackendCoinsUpdate()
}
}
if($coin->network_hash)
if($coin->network_hash) {
$coin->network_ttf = $coin->difficulty * 0x100000000 / $coin->network_hash;
// BTC network_hash unit may be wrong... prevent db int(11) overflow
if($coin->network_ttf > 9999999999) $coin->network_ttf = 0;
}
if(isset($pool_rate[$coin->algo]))
$coin->pool_ttf = $coin->difficulty * 0x100000000 / $pool_rate[$coin->algo];