From 17875d358fdfbe1721bb58a1cb658b51adc1ce39 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 17 Jul 2017 06:19:40 +0200 Subject: [PATCH] backend: ignore btc net hash overflow #141 could be due to the unit for the network_hash.. quick fix --- web/yaamp/core/backend/coins.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/yaamp/core/backend/coins.php b/web/yaamp/core/backend/coins.php index 8d7a5dc..be47bfd 100644 --- a/web/yaamp/core/backend/coins.php +++ b/web/yaamp/core/backend/coins.php @@ -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];