mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
backend: more proper int overflow on pool_ttf #141
related to mysql 5.7, int(11) seems no more supported
This commit is contained in:
parent
9bfb531d03
commit
ad3968fa69
1 changed files with 4 additions and 7 deletions
|
@ -283,16 +283,13 @@ function BackendCoinsUpdate()
|
|||
}
|
||||
|
||||
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;
|
||||
$coin->network_ttf = intval($coin->difficulty * 0x100000000 / $coin->network_hash);
|
||||
if($coin->network_ttf > 2147483647) $coin->network_ttf = 2147483647;
|
||||
}
|
||||
|
||||
if(isset($pool_rate[$coin->algo]))
|
||||
$coin->pool_ttf = $coin->difficulty * 0x100000000 / $pool_rate[$coin->algo];
|
||||
|
||||
if ($coin->pool_ttf > 9999999999) $coin->pool_ttf = 0;
|
||||
$coin->pool_ttf = intval($coin->difficulty * 0x100000000 / $pool_rate[$coin->algo]);
|
||||
if($coin->pool_ttf > 2147483647) $coin->pool_ttf = 2147483647;
|
||||
|
||||
if(strstr($coin->image, 'http'))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue