From e2011a68b0815f3061eb1dded675726b25ad82d4 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Thu, 12 Sep 2013 08:30:34 +0200 Subject: [PATCH 1/8] [FIX] Unconfirmed Wallet Balance Fixes #646 --- public/include/pages/admin/wallet.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/include/pages/admin/wallet.inc.php b/public/include/pages/admin/wallet.inc.php index de201523..da7c5ed9 100644 --- a/public/include/pages/admin/wallet.inc.php +++ b/public/include/pages/admin/wallet.inc.php @@ -25,7 +25,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to wallet RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'errormsg'); } // Fetch unconfirmed amount from blocks table - $aBlocksUnconfirmed = $block->getAllUnconfirmed(); + empty($this->config['network_confirmations']) ? $confirmations = 120 : $confirmations = $this->config['network_confirmations']; + $aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations); $dBlocksUnconfirmedBalance = 0; if (!empty($aBlocksUnconfirmed)) foreach ($aBlocksUnconfirmed as $aData) $dBlocksUnconfirmedBalance += $aData['amount']; From d2eb288dec632429c7a5696fd9799f068dd1a90a Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 13 Sep 2013 08:02:45 +0200 Subject: [PATCH 2/8] Update POOLS.md --- POOLS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/POOLS.md b/POOLS.md index 723c3e53..1bf0c5ab 100644 --- a/POOLS.md +++ b/POOLS.md @@ -117,3 +117,9 @@ Small Time Miners are running various stratum only pools for different coins. | Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes | | -------- | ---- | ------------: | ------------------: | ----- | | http://poolmine.it | Litecoin | 0.23 MHash | 5 | PPLNS, Custom Template | + +### 4782 + +| Pool URL | Coin | Avg. Hashrate | Avg. Active Workers | Notes | +| -------- | ---- | ------------: | ------------------: | ----- | +| http://pirate-pool.com | LTC | 0.5 MHash | 2 | | From 9b7191f4fdbb0675a38380c938294cbbbd189277 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 13 Sep 2013 08:09:19 +0200 Subject: [PATCH 3/8] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 95a26d3f..84907d5d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ I was hoping to keep this out of the README but apparently people remove or chan at the bottom of the page. For those of you finding my project and are willing to appreciate the work with some hard earned LTC feel free to donate to my LTC address: `Lge95QR2frp9y1wJufjUPCycVsg5gLJPW8` +# Website Footer + +When you decide to use `mmcfe-ng` please be so kind and leave the footer intact. You are not the author of the software and should honor those that have worked on it. I don't mind changing the LTC donation address at the bottom, but keep in mind who really wrote this software and would deserve those ;-). + Donors ====== From aa10b6efc1ee02f4817f302b36003b0f976a708d Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 13 Sep 2013 13:36:36 +0200 Subject: [PATCH 4/8] [FEATURE] Adding hashrate modifiers * Allow admins to set hashrate speed displays via admin panel * Personal * Pool * Network * Allows for easier integration of SHA coins Fixes #652 --- public/include/config/admin_settings.inc.php | 21 ++++++++++ public/include/smarty_globals.inc.php | 38 +++++++++++++++---- public/templates/mmcFE/global/header.tpl | 4 +- .../templates/mmcFE/global/sidebar_pplns.tpl | 2 +- public/templates/mmcFE/global/sidebar_pps.tpl | 2 +- .../templates/mmcFE/global/sidebar_prop.tpl | 2 +- .../mmcFE/statistics/pool/authenticated.tpl | 2 +- .../statistics/pool/contributors_hashrate.tpl | 4 +- 8 files changed, 60 insertions(+), 15 deletions(-) diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 69b55e75..6f99ac82 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -102,6 +102,27 @@ $aSettings['statistics'][] = array( 'name' => 'statistics_block_count', 'value' => $setting->getValue('statistics_block_count'), 'tooltip' => 'Blocks to fetch for the block statistics page.' ); +$aSettings['statistics'][] = array( + 'display' => 'Pool Hashrate Modifier', 'type' => 'select', + 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' ), + 'default' => '1', + 'name' => 'statistics_pool_hashrate_modifier', 'value' => $setting->getValue('statistics_pool_hashrate_modifier'), + 'tooltip' => 'Auto-adjust displayed pool hashrates to a certain limit.' +); +$aSettings['statistics'][] = array( + 'display' => 'Network Hashrate Modifier', 'type' => 'select', + 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' ), + 'default' => '1', + 'name' => 'statistics_network_hashrate_modifier', 'value' => $setting->getValue('statistics_network_hashrate_modifier'), + 'tooltip' => 'Auto-adjust displayed network hashrates to a certain limit.' +); +$aSettings['statistics'][] = array( + 'display' => 'Personal Hashrate Modifier', 'type' => 'select', + 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' ), + 'default' => '1', + 'name' => 'statistics_personal_hashrate_modifier', 'value' => $setting->getValue('statistics_personal_hashrate_modifier'), + 'tooltip' => 'Auto-adjust displayed personal hashrates to a certain limit.' +); $aSettings['acl'][] = array( 'display' => 'Pool Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public'), diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index d457ee4e..acce6725 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -17,21 +17,45 @@ if ($bitcoin->can_connect() === true) { $dDifficulty = $bitcoin->query('getdifficulty'); if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty)) $dDifficulty = $dDifficulty['proof-of-work']; + try { $dNetworkHashrate = $bitcoin->query('getnetworkhashps') / 1000; } catch (Exception $e) { + // Maybe we are SHA + try { $dNetworkHashrate = $bitcoin->query('gethashespersec') / 1000; } catch (Exception $e) { + $dNetworkHashrate = 0; + } + $dNetworkHashrate = 0; + } +} else { + $dNetworkHashrate = 0; } -// Always fetch this since we need for ministats header -$bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetworkhashps') : $dNetworkHashrate = 0; - -// Fetch some data -if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0; +// Baseline pool hashrate for templates +if ( ! $dPoolHashrateModifier = $setting->getValue('statistics_pool_hashrate_modifier') ) $dPoolHashrateModifier = 1; $iCurrentPoolHashrate = $statistics->getCurrentHashrate(); -$iCurrentPoolShareRate = $statistics->getCurrentShareRate(); // Avoid confusion, ensure our nethash isn't higher than poolhash if ($iCurrentPoolHashrate > $dNetworkHashrate) $dNetworkHashrate = $iCurrentPoolHashrate; +// Baseline network hashrate for templates +if ( ! $dPersonalHashrateModifier = $setting->getValue('statistics_personal_hashrate_modifier') ) $dPersonalHashrateModifier = 1; +if ( ! $dNetworkHashrateModifier = $setting->getValue('statistics_network_hashrate_modifier') ) $dNetworkHashrateModifier = 1; + +// Apply modifier now +$dNetworkHashrate = $dNetworkHashrate * $dNetworkHashrateModifier; +$iCurrentPoolHashrate = $iCurrentPoolHashrate * $dPoolHashrateModifier; + +// Share rate of the entire pool +$iCurrentPoolShareRate = $statistics->getCurrentShareRate(); + +// Active workers +if (!$iCurrentActiveWorkers = $worker->getCountAllActiveWorkers()) $iCurrentActiveWorkers = 0; + +// Small helper array +$aHashunits = array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s' ); + // Global data for Smarty $aGlobal = array( + 'hashunits' => array( 'pool' => $aHashunits[$dPoolHashrateModifier], 'network' => $aHashunits[$dNetworkHashrateModifier], 'personal' => $aHashunits[$dPersonalHashrateModifier]), + 'hashmods' => array( 'personal' => $dPersonalHashrateModifier ), 'hashrate' => $iCurrentPoolHashrate, 'nethashrate' => $dNetworkHashrate, 'sharerate' => $iCurrentPoolShareRate, @@ -93,7 +117,7 @@ if (@$_SESSION['USERDATA']['id']) { // Other userdata that we can cache savely $aGlobal['userdata']['shares'] = $statistics->getUserShares($_SESSION['USERDATA']['id']); - $aGlobal['userdata']['hashrate'] = $statistics->getUserHashrate($_SESSION['USERDATA']['id']); + $aGlobal['userdata']['hashrate'] = $statistics->getUserHashrate($_SESSION['USERDATA']['id']) * $dPersonalHashrateModifier; $aGlobal['userdata']['sharerate'] = $statistics->getUserSharerate($_SESSION['USERDATA']['id']); switch ($config['payout_system']) { diff --git a/public/templates/mmcFE/global/header.tpl b/public/templates/mmcFE/global/header.tpl index 9b03db7e..4d2e9b18 100644 --- a/public/templates/mmcFE/global/header.tpl +++ b/public/templates/mmcFE/global/header.tpl @@ -5,8 +5,8 @@ {if $GLOBAL.config.price.currency}{/if} - - + + diff --git a/public/templates/mmcFE/global/sidebar_pplns.tpl b/public/templates/mmcFE/global/sidebar_pplns.tpl index a39bce8d..fa11f94d 100644 --- a/public/templates/mmcFE/global/sidebar_pplns.tpl +++ b/public/templates/mmcFE/global/sidebar_pplns.tpl @@ -16,7 +16,7 @@ - + diff --git a/public/templates/mmcFE/global/sidebar_pps.tpl b/public/templates/mmcFE/global/sidebar_pps.tpl index 1268880a..2759fc27 100644 --- a/public/templates/mmcFE/global/sidebar_pps.tpl +++ b/public/templates/mmcFE/global/sidebar_pps.tpl @@ -11,7 +11,7 @@ - + diff --git a/public/templates/mmcFE/global/sidebar_prop.tpl b/public/templates/mmcFE/global/sidebar_prop.tpl index 69afe6ee..3c6206e0 100644 --- a/public/templates/mmcFE/global/sidebar_prop.tpl +++ b/public/templates/mmcFE/global/sidebar_prop.tpl @@ -11,7 +11,7 @@ - + diff --git a/public/templates/mmcFE/statistics/pool/authenticated.tpl b/public/templates/mmcFE/statistics/pool/authenticated.tpl index b19848db..870909c5 100644 --- a/public/templates/mmcFE/statistics/pool/authenticated.tpl +++ b/public/templates/mmcFE/statistics/pool/authenticated.tpl @@ -9,7 +9,7 @@ - + diff --git a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl index a7f3cd9f..212a4695 100644 --- a/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl +++ b/public/templates/mmcFE/statistics/pool/contributors_hashrate.tpl @@ -5,7 +5,7 @@ - + {if $GLOBAL.config.price.currency}{/if} @@ -18,7 +18,7 @@ - + {if $GLOBAL.config.price.currency}{/if} From 2e9332b7a01399959f9ee3ffcdd7a1dcc19ab7d0 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 13 Sep 2013 15:49:07 +0200 Subject: [PATCH 5/8] fixed cryptsy API example --- public/include/config/global.inc.dist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/config/global.inc.dist.php b/public/include/config/global.inc.dist.php index 682cf4a8..6bb31a2b 100644 --- a/public/include/config/global.inc.dist.php +++ b/public/include/config/global.inc.dist.php @@ -78,7 +78,7 @@ $config['wallet']['password'] = 'testnet'; * currency = `BTC` * * Optional (cryptsy.com): - * url = `https://www.cryptsy.com` + * url = `https://pubapi.cryptsy.com` * target = `/api.php?method=marketdata` * currency = `BTC` **/ From c20c9619a4627a53e9f26f5ba862bfbe94e45065 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sat, 14 Sep 2013 09:37:08 +0200 Subject: [PATCH 6/8] Update wallet.inc.php --- public/include/pages/admin/wallet.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/pages/admin/wallet.inc.php b/public/include/pages/admin/wallet.inc.php index da7c5ed9..5ce4182a 100644 --- a/public/include/pages/admin/wallet.inc.php +++ b/public/include/pages/admin/wallet.inc.php @@ -25,7 +25,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to wallet RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'errormsg'); } // Fetch unconfirmed amount from blocks table - empty($this->config['network_confirmations']) ? $confirmations = 120 : $confirmations = $this->config['network_confirmations']; + empty($config['network_confirmations']) ? $confirmations = 120 : $confirmations = $config['network_confirmations']; $aBlocksUnconfirmed = $block->getAllUnconfirmed($confirmations); $dBlocksUnconfirmedBalance = 0; if (!empty($aBlocksUnconfirmed)) From 8ad5a234c06b892b8d4260217da7c5e2091d630b Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 16 Sep 2013 15:41:23 +0200 Subject: [PATCH 7/8] fixing website name in pub api --- public/include/pages/api/public.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/pages/api/public.inc.php b/public/include/pages/api/public.inc.php index 3fe69708..7e7c1f6e 100644 --- a/public/include/pages/api/public.inc.php +++ b/public/include/pages/api/public.inc.php @@ -15,7 +15,7 @@ $bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetwo echo json_encode( array( - 'pool_name' => $config['website']['name'], + 'pool_name' => $setting->getValue('website_name'), 'hashrate' => $statistics->getCurrentHashrate(), 'workers' => $worker->getCountAllActiveWorkers(), 'shares_this_round' => $aShares['valid'], From 8abe371fbaa35d411c78e2f10993f4ab454df50a Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 16 Sep 2013 17:25:04 +0200 Subject: [PATCH 8/8] fixing cryptsy again, ty @Metice --- public/include/config/global.inc.dist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/include/config/global.inc.dist.php b/public/include/config/global.inc.dist.php index 6bb31a2b..d2302b0c 100644 --- a/public/include/config/global.inc.dist.php +++ b/public/include/config/global.inc.dist.php @@ -78,9 +78,9 @@ $config['wallet']['password'] = 'testnet'; * currency = `BTC` * * Optional (cryptsy.com): - * url = `https://pubapi.cryptsy.com` - * target = `/api.php?method=marketdata` + * url = `http://pubapi.cryptsy.com` * currency = `BTC` + * target = `/api.php?method=marketdata` **/ $config['price']['url'] = 'https://btc-e.com'; $config['price']['target'] = '/api/2/ltc_usd/ticker';
  • {$GLOBAL.config.currency}/{$GLOBAL.config.price.currency}: {$GLOBAL.price|default:"0"|number_format:"4"}    
  • Network Hashrate: {($GLOBAL.nethashrate / 1000 / 1000 )|default:"0"|number_format:"3"} MH/s    
  • Pool Hashrate: {($GLOBAL.hashrate / 1000)|number_format:"3"} MH/s    
  • Network Hashrate: {$GLOBAL.nethashrate|default:"0"|number_format:"3"} {$GLOBAL.hashunits.network}    
  • Pool Hashrate: {$GLOBAL.hashrate|number_format:"3"} {$GLOBAL.hashunits.pool}    
  • Pool Sharerate: {$GLOBAL.sharerate|number_format:"2"} Shares/s    
  • Pool Workers: {$GLOBAL.workers|default:"0"}    
  • Hashrate{$GLOBAL.userdata.hashrate|number_format} KH/s{$GLOBAL.userdata.hashrate|number_format:"2"} {$GLOBAL.hashunits.personal}
    Unpaid Shares
    Hashrate{$GLOBAL.userdata.hashrate|number_format} KH/s{$GLOBAL.userdata.hashrate|number_format:"2"} {$GLOBAL.hashunits.personal}
    Share Rate
    Hashrate{$GLOBAL.userdata.hashrate|number_format} KH/s{$GLOBAL.userdata.hashrate|number_format:"2"} {$GLOBAL.hashunits.personal}
    Unpaid Shares
    Pool Hash Rate{($GLOBAL.hashrate / 1000)|number_format:"3"} Mhash/s{$GLOBAL.hashrate|number_format:"3"} {$GLOBAL.hashunits.pool}
    Pool Efficiency
    Rank User NameKH/s{$GLOBAL.hashunits.personal} {$GLOBAL.config.currency}/Day{$GLOBAL.config.price.currency}/Day
    {$rank++} {if $CONTRIBHASHES[contrib].is_anonymous|default:"0" == 1}anonymous{else}{$CONTRIBHASHES[contrib].account|escape}{/if}{$CONTRIBHASHES[contrib].hashrate|number_format}{($CONTRIBHASHES[contrib].hashrate * $GLOBAL.hashmods.personal)|number_format:"2"} {$estday|number_format:"3"}{($estday * $GLOBAL.price)|default:"n/a"|number_format:"2"}