Merge branch 'next' of https://github.com/TheSerapher/php-mpos into next
This commit is contained in:
commit
eb9f63b821
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,3 +3,6 @@
|
||||
/cronjobs/logs/*.txt
|
||||
/cronjobs/logs/*.txt.*.gz
|
||||
/public/templates/cache/*.php
|
||||
# Test configs
|
||||
public/include/config/global.inc.scrypt.php
|
||||
public/include/config/global.inc.sha.php
|
||||
|
||||
14
cronjobs/findblock.php
Executable file → Normal file
14
cronjobs/findblock.php
Executable file → Normal file
@ -75,17 +75,21 @@ if (empty($aAllBlocks)) {
|
||||
$log->logDebug('No new blocks without share_id found in database');
|
||||
} else {
|
||||
// Loop through our unaccounted blocks
|
||||
$log->logInfo("Block ID\tHeight\t\tAmount\tShare ID\tShares\tFinder\t\tType");
|
||||
$log->logInfo("Block ID\tHeight\t\tAmount\tShare ID\tShares\tFinder\tWorker\t\tType");
|
||||
foreach ($aAllBlocks as $iIndex => $aBlock) {
|
||||
if (empty($aBlock['share_id'])) {
|
||||
// Fetch share information
|
||||
if ( !$iPreviousShareId = $block->getLastShareId())
|
||||
$iPreviousShareId = 0;
|
||||
|
||||
// Fetch this blocks upstream ID
|
||||
$aBlockRPCInfo = $bitcoin->query('getblock', $aBlock['blockhash']);
|
||||
if ($share->findUpstreamShare($aBlockRPCInfo, $iPreviousShareId)) {
|
||||
$iCurrentUpstreamId = $share->getUpstreamShareId();
|
||||
// Rarely happens, but did happen once to me
|
||||
if ($iCurrentUpstreamId == $iPreviousShareId) {
|
||||
$log->logFatal($share->getErrorMsg('E0063'));
|
||||
$monitoring->endCronjob($cron_name, 'E0063', 1, true);
|
||||
}
|
||||
// Out of order share detection
|
||||
if ($iCurrentUpstreamId < $iPreviousShareId) {
|
||||
// Fetch our offending block
|
||||
@ -99,7 +103,7 @@ if (empty($aAllBlocks)) {
|
||||
// Shares seem to be out of order, so lets change them
|
||||
if ( !$share->updateShareById($iCurrentUpstreamId, $aShareError) || !$share->updateShareById($iPreviousShareId, $aShareCurrent)) {
|
||||
// We couldn't update one of the shares! That might mean they have been deleted already
|
||||
$log->logFatal('E0003: Failed to change shares order!');
|
||||
$log->logFatal('E0003: Failed to change shares order: ' . $share->getCronError());
|
||||
$monitoring->endCronjob($cron_name, 'E0003', 1, true);
|
||||
}
|
||||
// Reset our offending block so the next run re-checks the shares
|
||||
@ -112,6 +116,7 @@ if (empty($aAllBlocks)) {
|
||||
} else {
|
||||
$iRoundShares = $share->getRoundShares($iPreviousShareId, $iCurrentUpstreamId);
|
||||
$iAccountId = $user->getUserId($share->getUpstreamFinder());
|
||||
$iWorker = $share->getUpstreamWorker();
|
||||
}
|
||||
} else {
|
||||
$log->logFatal('E0005: Unable to fetch blocks upstream share, aborted:' . $share->getCronError());
|
||||
@ -125,6 +130,7 @@ if (empty($aAllBlocks)) {
|
||||
. $iCurrentUpstreamId . "\t\t"
|
||||
. $iRoundShares . "\t"
|
||||
. "[$iAccountId] " . $user->getUserName($iAccountId) . "\t"
|
||||
. $iWorker . "\t"
|
||||
. $share->share_type
|
||||
);
|
||||
|
||||
@ -133,6 +139,8 @@ if (empty($aAllBlocks)) {
|
||||
$log->logError('Failed to update share ID in database for block ' . $aBlock['height'] . ': ' . $block->getCronError());
|
||||
if (!$block->setFinder($aBlock['id'], $iAccountId))
|
||||
$log->logError('Failed to update finder account ID in database for block ' . $aBlock['height'] . ': ' . $block->getCronError());
|
||||
if (!$block->setFindingWorker($aBlock['id'], $iWorker))
|
||||
$log->logError('Failed to update worker ID in database for block ' . $aBlock['height'] . ': ' . $block->getCronError());
|
||||
if (!$block->setShares($aBlock['id'], $iRoundShares))
|
||||
$log->logError('Failed to update share count in database for block ' . $aBlock['height'] . ': ' . $block->getCronError());
|
||||
if ($config['block_bonus'] > 0 && !$transaction->addTransaction($iAccountId, $config['block_bonus'], 'Bonus', $aBlock['id'])) {
|
||||
|
||||
@ -44,7 +44,7 @@ if (empty($aWorkers)) {
|
||||
$aData['email'] = $user->getUserEmail($aData['username']);
|
||||
$log->logDebug(" " . $aWorker['username'] . "...");
|
||||
if (!$notification->sendNotification($aWorker['account_id'], 'idle_worker', $aData))
|
||||
$log->logError(" Failed sending notifications: " . $notification->getCronError() . "\n");
|
||||
$log->logDebug(" Failed sending notifications: " . $notification->getCronError() . "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ if (!empty($aNotifications)) {
|
||||
if ($notification->setInactive($aNotification['id'])) {
|
||||
$log->logDebug(" updated #" . $aNotification['id'] . " for " . $aWorker['username'] . " as inactive\n");
|
||||
} else {
|
||||
$log->logInfo(" failed to update #" . $aNotification['id'] . " for " . $aWorker['username'] . "\n");
|
||||
$log->logError(" failed to update #" . $aNotification['id'] . " for " . $aWorker['username'] . "\n");
|
||||
}
|
||||
} else {
|
||||
$log->logDebug(" still inactive\n");
|
||||
|
||||
@ -38,11 +38,13 @@ if ($price = $tools->getPrice()) {
|
||||
}
|
||||
|
||||
// Update Uptime Robot status in Settings table via API call
|
||||
if ($api_keys = $setting->getValue('monitoring_uptimerobot_api_keys') && strstr($api_keys, '<API KEY>|<MONITOR ID>')) {
|
||||
$monitoring->setTools($tools);
|
||||
if (!$monitoring->storeUptimeRobotStatus()) {
|
||||
$log->logError($monitoring->getCronError());
|
||||
$monitoring->endCronjob($cron_name, 'E0017', 1, false);
|
||||
if ($api_keys = $setting->getValue('monitoring_uptimerobot_api_keys')) {
|
||||
if (!strstr($api_keys, '<API KEY>|<MONITOR ID>')) {
|
||||
$monitoring->setTools($tools);
|
||||
if (!$monitoring->storeUptimeRobotStatus()) {
|
||||
$log->logError($monitoring->getCronError());
|
||||
$monitoring->endCronjob($cron_name, 'E0017', 1, false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$log->logDebug('Skipped Uptime Robot API update, missing api keys');
|
||||
|
||||
@ -48,15 +48,21 @@ class BitcoinWrapper extends BitcoinClient {
|
||||
if ($data = $this->memcache->get(__FUNCTION__)) return $data;
|
||||
try {
|
||||
$dNetworkHashrate = $this->query('getmininginfo');
|
||||
if (is_array($dNetworkHashrate) && array_key_exists('networkhashps', $dNetworkHashrate)) {
|
||||
$dNetworkHashrate = $dNetworkHashrate['networkhashps'];
|
||||
} else if (is_array($dNetworkHashrate) && array_key_exists('hashespersec', $dNetworkHashrate)) {
|
||||
$dNetworkHashrate = $dNetworkHashrate['hashespersec'];
|
||||
} else if (is_array($dNetworkHashrate) && array_key_exists('netmhashps', $dNetworkHashrate)) {
|
||||
$dNetworkHashrate = $dNetworkHashrate['netmhashps'] * 1000 * 1000;
|
||||
if (is_array($dNetworkHashrate)) {
|
||||
if (array_key_exists('networkhashps', $dNetworkHashrate)) {
|
||||
$dNetworkHashrate = $dNetworkHashrate['networkhashps'];
|
||||
} else if (array_key_exists('hashespersec', $dNetworkHashrate)) {
|
||||
$dNetworkHashrate = $dNetworkHashrate['hashespersec'];
|
||||
} else if (array_key_exists('netmhashps', $dNetworkHashrate)) {
|
||||
$dNetworkHashrate = $dNetworkHashrate['netmhashps'] * 1000 * 1000;
|
||||
} else {
|
||||
// Unsupported implementation
|
||||
$dNetworkHashrate = 0;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
// getmininginfo does not exist, cache for an hour
|
||||
return $this->memcache->setCache(__FUNCTION__, 0, 3600);
|
||||
}
|
||||
return $this->memcache->setCache(__FUNCTION__, $dNetworkHashrate, 30);
|
||||
}
|
||||
|
||||
@ -197,6 +197,17 @@ class Block extends Base {
|
||||
$field = array( 'name' => 'account_id', 'value' => $account_id, 'type' => 'i' );
|
||||
return $this->updateSingle($block_id, $field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set finding worker of a block
|
||||
* @param block_id int Block ID
|
||||
* @param worker_id int Worker ID of finder
|
||||
* @return bool
|
||||
**/
|
||||
public function setFindingWorker($block_id, $worker=NULL) {
|
||||
$field = array( 'name' => 'worker_name', 'value' => $worker, 'type' => 's' );
|
||||
return $this->updateSingle($block_id, $field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set finding share for a block
|
||||
|
||||
@ -231,6 +231,9 @@ class Share Extends Base {
|
||||
public function getUpstreamFinder() {
|
||||
return @$this->oUpstream->account;
|
||||
}
|
||||
public function getUpstreamWorker() {
|
||||
return @$this->oUpstream->worker;
|
||||
}
|
||||
public function getUpstreamShareId() {
|
||||
return @$this->oUpstream->id;
|
||||
}
|
||||
@ -254,39 +257,39 @@ class Share Extends Base {
|
||||
$header_hex = implode(unpack("H*", $header_bin));
|
||||
|
||||
// Stratum supported blockhash solution entry
|
||||
$stmt = $this->mysqli->prepare("SELECT SUBSTRING_INDEX( `username` , '.', 1 ) AS account, id FROM $this->table WHERE solution = ? LIMIT 1");
|
||||
$stmt = $this->mysqli->prepare("SELECT SUBSTRING_INDEX( `username` , '.', 1 ) AS account, username as worker, id FROM $this->table WHERE solution = ? LIMIT 1");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $aBlock['hash']) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
$this->oUpstream = $result->fetch_object();
|
||||
$this->share_type = 'stratum_blockhash';
|
||||
if (!empty($this->oUpstream->account) && is_int($this->oUpstream->id))
|
||||
if (!empty($this->oUpstream->account) && !empty($this->oUpstream->worker) && is_int($this->oUpstream->id))
|
||||
return true;
|
||||
}
|
||||
|
||||
// Stratum scrypt hash check
|
||||
$scrypt_hash = swapEndian(bin2hex(Scrypt::calc($header_bin, $header_bin, 1024, 1, 1, 32)));
|
||||
$stmt = $this->mysqli->prepare("SELECT SUBSTRING_INDEX( `username` , '.', 1 ) AS account, id FROM $this->table WHERE solution = ? LIMIT 1");
|
||||
$stmt = $this->mysqli->prepare("SELECT SUBSTRING_INDEX( `username` , '.', 1 ) AS account, username as worker, id FROM $this->table WHERE solution = ? LIMIT 1");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $scrypt_hash) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
$this->oUpstream = $result->fetch_object();
|
||||
$this->share_type = 'stratum_solution';
|
||||
if (!empty($this->oUpstream->account) && is_int($this->oUpstream->id))
|
||||
if (!empty($this->oUpstream->account) && !empty($this->oUpstream->worker) && is_int($this->oUpstream->id))
|
||||
return true;
|
||||
}
|
||||
|
||||
// Failed to fetch via startum solution, try pushpoold
|
||||
// Fallback to pushpoold solution type
|
||||
$ppheader = sprintf('%08d', $aBlock['version']) . word_reverse($aBlock['previousblockhash']) . word_reverse($aBlock['merkleroot']) . dechex($aBlock['time']) . $aBlock['bits'] . dechex($aBlock['nonce']);
|
||||
$stmt = $this->mysqli->prepare("SELECT SUBSTRING_INDEX( `username` , '.', 1 ) AS account, id FROM $this->table WHERE solution LIKE CONCAT(?, '%') LIMIT 1");
|
||||
$stmt = $this->mysqli->prepare("SELECT SUBSTRING_INDEX( `username` , '.', 1 ) AS account, username as worker, id FROM $this->table WHERE solution LIKE CONCAT(?, '%') LIMIT 1");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $ppheader) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
$this->oUpstream = $result->fetch_object();
|
||||
$this->share_type = 'pp_solution';
|
||||
if (!empty($this->oUpstream->account) && is_int($this->oUpstream->id))
|
||||
if (!empty($this->oUpstream->account) && !empty($this->oUpstream->worker) && is_int($this->oUpstream->id))
|
||||
return true;
|
||||
}
|
||||
|
||||
// Still no match, try upstream result with timerange
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
SUBSTRING_INDEX( `username` , '.', 1 ) AS account, id
|
||||
SUBSTRING_INDEX( `username` , '.', 1 ) AS account, username as worker, id
|
||||
FROM $this->table
|
||||
WHERE upstream_result = 'Y'
|
||||
AND id > ?
|
||||
@ -296,14 +299,14 @@ class Share Extends Base {
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('iii', $last, $aBlock['time'], $aBlock['time']) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
$this->oUpstream = $result->fetch_object();
|
||||
$this->share_type = 'upstream_share';
|
||||
if (!empty($this->oUpstream->account) && is_int($this->oUpstream->id))
|
||||
if (!empty($this->oUpstream->account) && !empty($this->oUpstream->worker) && is_int($this->oUpstream->id))
|
||||
return true;
|
||||
}
|
||||
|
||||
// We failed again, now we take ANY result matching the timestamp
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
SUBSTRING_INDEX( `username` , '.', 1 ) AS account, id
|
||||
SUBSTRING_INDEX( `username` , '.', 1 ) AS account, username as worker, id
|
||||
FROM $this->table
|
||||
WHERE our_result = 'Y'
|
||||
AND id > ?
|
||||
@ -312,10 +315,11 @@ class Share Extends Base {
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $last, $aBlock['time']) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
$this->oUpstream = $result->fetch_object();
|
||||
$this->share_type = 'any_share';
|
||||
if (!empty($this->oUpstream->account) && is_int($this->oUpstream->id))
|
||||
if (!empty($this->oUpstream->account) && !empty($this->oUpstream->worker) && is_int($this->oUpstream->id))
|
||||
return true;
|
||||
}
|
||||
return $this->getErrorMsg('E0052', $aBlock['height']);
|
||||
$this->setErrorMessage($this->getErrorMsg('E0052', $aBlock['height']));
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -122,7 +122,7 @@ class Statistics extends Base {
|
||||
**/
|
||||
public function getBlocksFoundHeight($iHeight=0, $limit=10) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
if ($data = $this->memcache->get(__FUNCTION__ . $iHeight . $limit)) return $data;
|
||||
if ($data = $this->memcache->get(__FUNCTION__ . $iHeight . $limit)) return $data;
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
b.*,
|
||||
@ -139,6 +139,54 @@ class Statistics extends Base {
|
||||
return $this->sqlError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SUM of blocks found and generated Coins for each Account
|
||||
* @param limit int Last limit blocks
|
||||
* @return array
|
||||
**/
|
||||
public function getBlocksSolvedbyAccount($limit=25) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
if ($data = $this->memcache->get(__FUNCTION__ . $limit)) return $data;
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
b.*,
|
||||
a.username AS finder,
|
||||
a.is_anonymous AS is_anonymous,
|
||||
COUNT(b.id) AS solvedblocks,
|
||||
SUM(b.amount) AS generatedcoins
|
||||
FROM " . $this->block->getTableName() . " AS b
|
||||
LEFT JOIN " . $this->user->getTableName() . " AS a
|
||||
ON b.account_id = a.id
|
||||
WHERE confirmations > 0
|
||||
GROUP BY finder
|
||||
ORDER BY solvedblocks DESC LIMIT ?");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param("i", $limit) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $this->memcache->setCache(__FUNCTION__ . $limit, $result->fetch_all(MYSQLI_ASSOC), 5);
|
||||
return $this->sqlError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SUM of blocks found and generated Coins for each worker
|
||||
* @param limit int Last limit blocks
|
||||
* @return array
|
||||
**/
|
||||
public function getBlocksSolvedbyWorker($account_id, $limit=25) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
if ($data = $this->memcache->get(__FUNCTION__ . $account_id . $limit)) return $data;
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
worker_name AS finder,
|
||||
COUNT(id) AS solvedblocks,
|
||||
SUM(amount) AS generatedcoins
|
||||
FROM " . $this->block->getTableName() . "
|
||||
WHERE account_id = ? AND worker_name != 'unknown'
|
||||
GROUP BY finder
|
||||
ORDER BY solvedblocks DESC LIMIT ?");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $account_id, $limit) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $this->memcache->setCache(__FUNCTION__ . $account_id . $limit, $result->fetch_all(MYSQLI_ASSOC), 5);
|
||||
return $this->sqlError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Currently the only function writing to the database
|
||||
* Stored per block user statistics of valid and invalid shares
|
||||
@ -356,11 +404,10 @@ class Statistics extends Base {
|
||||
|
||||
/**
|
||||
* Admin panel specific query
|
||||
* @return data array invlid and valid shares for all accounts
|
||||
* @return data array User settings and shares
|
||||
**/
|
||||
public function getAllUserStats($filter='%') {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $filter)) return $data;
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
a.id AS id,
|
||||
@ -369,17 +416,20 @@ class Statistics extends Base {
|
||||
a.no_fees as no_fees,
|
||||
a.username AS username,
|
||||
a.donate_percent AS donate_percent,
|
||||
a.email AS email,
|
||||
ROUND(IFNULL(SUM(IF(s.difficulty=0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty)), 0) / POW(2, (" . $this->config['difficulty'] . " - 16)), 0) AS shares
|
||||
a.email AS email
|
||||
FROM " . $this->user->getTableName() . " AS a
|
||||
LEFT JOIN " . $this->share->getTableName() . " AS s
|
||||
ON a.username = SUBSTRING_INDEX( s.username, '.', 1 )
|
||||
WHERE
|
||||
a.username LIKE ?
|
||||
GROUP BY username
|
||||
ORDER BY username");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $filter) && $stmt->execute() && $result = $stmt->get_result())
|
||||
return $this->memcache->setCache(__FUNCTION__ . $filter, $result->fetch_all(MYSQLI_ASSOC));
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $filter) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||
// Add our cached shares to the users
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$row['shares'] = $this->getUserShares($row['id']);
|
||||
$aUsers[] = $row;
|
||||
}
|
||||
return $aUsers;
|
||||
}
|
||||
return $this->sqlError();
|
||||
}
|
||||
|
||||
|
||||
@ -187,6 +187,13 @@ $aSettings['acl'][] = array(
|
||||
'name' => 'acl_round_statistics', 'value' => $setting->getValue('acl_round_statistics'),
|
||||
'tooltip' => 'Make the round statistics page private (users only) or public.'
|
||||
);
|
||||
$aSettings['acl'][] = array(
|
||||
'display' => 'Block Finder Statistics', 'type' => 'select',
|
||||
'options' => array( 0 => 'Private', 1 => 'Public'),
|
||||
'default' => 1,
|
||||
'name' => 'acl_blockfinder_statistics', 'value' => $setting->getValue('acl_blockfinder_statistics'),
|
||||
'tooltip' => 'Make the Block Finder Statistics page private (users only) or public.'
|
||||
);
|
||||
$aSettings['acl'][] = array(
|
||||
'display' => 'Uptime Statistics', 'type' => 'select',
|
||||
'options' => array( 0 => 'Private', 1 => 'Public'),
|
||||
@ -257,6 +264,20 @@ $aSettings['system'][] = array(
|
||||
'name' => 'disable_contactform', 'value' => $setting->getValue('disable_contactform'),
|
||||
'tooltip' => 'Enable or Disable Contactform. Users will not be able to use the contact form.'
|
||||
);
|
||||
$aSettings['system'][] = array(
|
||||
'display' => 'Disable Donors Page', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes'),
|
||||
'default' => 1,
|
||||
'name' => 'disable_donors', 'value' => $setting->getValue('disable_donors'),
|
||||
'tooltip' => 'Showing Donors page in Navigation.'
|
||||
);
|
||||
$aSettings['system'][] = array(
|
||||
'display' => 'Disable About Page', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes'),
|
||||
'default' => 1,
|
||||
'name' => 'disable_about', 'value' => $setting->getValue('disable_about'),
|
||||
'tooltip' => 'Showing About page in Navigation.'
|
||||
);
|
||||
$aSettings['recaptcha'][] = array(
|
||||
'display' => 'Enable re-Captcha', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes' ),
|
||||
|
||||
@ -66,4 +66,5 @@ $aErrorCodes['E0059'] = 'Worker already exists';
|
||||
$aErrorCodes['E0060'] = 'Failed to add new worker';
|
||||
$aErrorCodes['E0061'] = 'Failed to delete worker';
|
||||
$aErrorCodes['E0062'] = 'Block has no share_id, not running payouts';
|
||||
$aErrorCodes['E0063'] = 'Upstream share already assigned to previous block';
|
||||
?>
|
||||
|
||||
@ -69,9 +69,6 @@ $config['wallet']['host'] = 'localhost:19334';
|
||||
$config['wallet']['username'] = 'testnet';
|
||||
$config['wallet']['password'] = 'testnet';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Getting Started Config
|
||||
*
|
||||
@ -83,9 +80,6 @@ $config['wallet']['password'] = 'testnet';
|
||||
$config['gettingstarted']['coinname'] = 'Litecoin';
|
||||
$config['gettingstarted']['coinurl'] = 'http://www.litecoin.org';
|
||||
$config['gettingstarted']['stratumport'] = '3333';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API configuration to fetch prices for set currency
|
||||
@ -115,7 +109,6 @@ $config['price']['url'] = 'https://btc-e.com';
|
||||
$config['price']['target'] = '/api/2/ltc_usd/ticker';
|
||||
$config['price']['currency'] = 'USD';
|
||||
|
||||
|
||||
/**
|
||||
* Automatic payout thresholds
|
||||
*
|
||||
|
||||
@ -3,9 +3,15 @@
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY')) die('Hacking attempt');
|
||||
|
||||
$aDonors = $transaction->getDonations();
|
||||
if ($setting->getValue('disable_donors')) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Donors are currently disabled. Please try again later.', 'TYPE' => 'errormsg');
|
||||
$smarty->assign("CONTENT", "disabled.tpl");
|
||||
} else {
|
||||
$aDonors = $transaction->getDonations();
|
||||
|
||||
// Tempalte specifics
|
||||
$smarty->assign("DONORS", $aDonors);
|
||||
$smarty->assign("CONTENT", "default.tpl");
|
||||
}
|
||||
|
||||
// Tempalte specifics
|
||||
$smarty->assign("DONORS", $aDonors);
|
||||
$smarty->assign("CONTENT", "default.tpl");
|
||||
?>
|
||||
|
||||
@ -4,6 +4,12 @@
|
||||
if (!defined('SECURITY'))
|
||||
die('Hacking attempt');
|
||||
|
||||
// Tempalte specifics
|
||||
$smarty->assign("CONTENT", "default.tpl");
|
||||
if ($setting->getValue('disable_about')) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Donors are currently disabled. Please try again later.', 'TYPE' => 'errormsg');
|
||||
$smarty->assign("CONTENT", "disabled.tpl");
|
||||
} else {
|
||||
// Tempalte specifics
|
||||
$smarty->assign("CONTENT", "default.tpl");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -31,23 +31,11 @@ if (@$_POST['query']) {
|
||||
$aUsers = $statistics->getAllUserStats($_POST['query']);
|
||||
|
||||
// Add additional stats to each user
|
||||
// This is not optimized yet, best is a proper SQL
|
||||
// Query against the stats table? Currently cached though.
|
||||
foreach ($aUsers as $iKey => $aUser) {
|
||||
$aBalance = $transaction->getBalance($aUser['id']);
|
||||
$aUser['balance'] = $aBalance['confirmed'];
|
||||
$aUser['hashrate'] = $statistics->getUserHashrate($aUser['id']);
|
||||
if ($aUser['shares'] > 0) {
|
||||
$aUser['payout']['est_block'] = round(( (int)$aUser['shares'] / (int)$aRoundShares['valid'] ) * (int)$config['reward'], 3);
|
||||
$aUser['payout']['est_fee'] = round(($config['fees'] / 100) * $aUser['payout']['est_block'], 3);
|
||||
$aUser['payout']['est_donation'] = round((( $aUser['donate_percent'] / 100) * ($aUser['payout']['est_block'] - $aUser['payout']['est_fee'])), 3);
|
||||
$aUser['payout']['est_payout'] = round($aUser['payout']['est_block'] - $aUser['payout']['est_donation'] - $aUser['payout']['est_fee'], 3);
|
||||
} else {
|
||||
$aUser['payout']['est_block'] = 0;
|
||||
$aUser['payout']['est_fee'] = 0;
|
||||
$aUser['payout']['est_donation'] = 0;
|
||||
$aUser['payout']['est_payout'] = 0;
|
||||
}
|
||||
$aUser['estimates'] = $statistics->getUserEstimates($aRoundShares, $aUser['shares'], $aUser['donate_percent'], $aUser['no_fees']);
|
||||
$aUsers[$iKey] = $aUser;
|
||||
}
|
||||
// Assign our variables
|
||||
|
||||
@ -91,7 +91,10 @@ $data = array(
|
||||
'shares' => array('valid' => $aUserRoundShares['valid'], 'invalid' => $aUserRoundShares['invalid'], 'invalid_percent' => $dUserInvalidPercent, 'unpaid' => $dUnpaidShares ),
|
||||
'balance' => $transaction->getBalance($user_id), 'estimates' => $aEstimates, 'workers' => $aWorkers ),
|
||||
'pool' => array(
|
||||
'name' => $setting->getValue('website_name'),
|
||||
'info' => array(
|
||||
'name' => $setting->getValue('website_name'),
|
||||
'currency' => $config['currency']
|
||||
),
|
||||
'workers' => $worker->getCountAllActiveWorkers(), 'hashrate' => $dPoolHashrateAdjusted,
|
||||
'shares' => array( 'valid' => $aRoundShares['valid'], 'invalid' => $aRoundShares['invalid'], 'invalid_percent' => $dPoolInvalidPercent, 'estimated' => $iEstShares, 'progress' => $dEstPercent ),
|
||||
'price' => $aPrice,
|
||||
|
||||
26
public/include/pages/statistics/blockfinder.inc.php
Normal file
26
public/include/pages/statistics/blockfinder.inc.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY')) die('Hacking attempt');
|
||||
|
||||
// Grab Block Finder
|
||||
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
$debug->append('No cached version available, fetching from backend', 3);
|
||||
|
||||
$getBlocksSolvedbyAccount = $statistics->getBlocksSolvedbyAccount();
|
||||
$smarty->assign("BLOCKSSOLVEDBYACCOUNT", $getBlocksSolvedbyAccount);
|
||||
} else {
|
||||
$debug->append('Using cached page', 3);
|
||||
}
|
||||
|
||||
if ($setting->getValue('acl_blockfinder_statistics')) {
|
||||
$smarty->assign("CONTENT", "finder.tpl");
|
||||
} else if ($user->isAuthenticated()) {
|
||||
$getBlocksSolvedbyWorker = $statistics->getBlocksSolvedbyWorker($_SESSION['USERDATA']['id']);
|
||||
$smarty->assign("BLOCKSSOLVEDBYWORKER", $getBlocksSolvedbyWorker);
|
||||
$smarty->assign("CONTENT", "finder.tpl");
|
||||
} else {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Block Finders are currently disabled. Please try again later.', 'TYPE' => 'errormsg');
|
||||
$smarty->assign("CONTENT", "default.tpl");
|
||||
}
|
||||
?>
|
||||
@ -22,7 +22,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
// Top hash contributors
|
||||
$aContributorsHashes = $statistics->getTopContributors('hashes', 15);
|
||||
|
||||
// Grab the last 10 blocks found
|
||||
// Grab the last 5 blocks found as a quick overview
|
||||
$iLimit = 5;
|
||||
$aBlocksFoundData = $statistics->getBlocksFound($iLimit);
|
||||
count($aBlocksFoundData) > 0 ? $aBlockData = $aBlocksFoundData[0] : $aBlockData = array();
|
||||
@ -34,22 +34,14 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
$iCurrentPoolHashrate > 0 ? $iEstTime = $dDifficulty * pow(2,32) / ($iCurrentPoolHashrate * 1000) : $iEstTime = 0;
|
||||
|
||||
// Time since last block
|
||||
$now = new DateTime( "now" );
|
||||
if (!empty($aBlockData)) {
|
||||
$dTimeSinceLast = ($now->getTimestamp() - $aBlockData['time']);
|
||||
$dTimeSinceLast = (time() - $aBlockData['time']);
|
||||
if ($dTimeSinceLast < 0) $dTimeSinceLast = 0;
|
||||
} else {
|
||||
$dTimeSinceLast = 0;
|
||||
}
|
||||
|
||||
// Past blocks found, max 4 weeks back
|
||||
$iFoundBlocksByTime = $statistics->getLastBlocksbyTime();
|
||||
$iFirstBlockFound = $statistics->getFirstBlockFound();
|
||||
$iTimeSinceFirstBlockFound = ($now->getTimestamp() - $iFirstBlockFound);
|
||||
|
||||
// Propagate content our template
|
||||
$smarty->assign("FIRSTBLOCKFOUND", $iTimeSinceFirstBlockFound);
|
||||
$smarty->assign("LASTBLOCKSBYTIME", $iFoundBlocksByTime);
|
||||
$smarty->assign("ESTTIME", $iEstTime);
|
||||
$smarty->assign("TIMESINCELAST", $dTimeSinceLast);
|
||||
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
|
||||
|
||||
@ -91,6 +91,8 @@ $aGlobal['website']['email'] = $setting->getValue('website_email');
|
||||
$aGlobal['website']['api']['disabled'] = $setting->getValue('disable_api');
|
||||
$aGlobal['website']['blockexplorer']['disabled'] = $setting->getValue('website_blockexplorer_disabled');
|
||||
$aGlobal['website']['chaininfo']['disabled'] = $setting->getValue('website_chaininfo_disabled');
|
||||
$aGlobal['website']['donors']['disabled'] = $setting->getValue('disable_donors');
|
||||
$aGlobal['website']['about']['disabled'] = $setting->getValue('disable_about');
|
||||
$setting->getValue('website_blockexplorer_url') ? $aGlobal['website']['blockexplorer']['url'] = $setting->getValue('website_blockexplorer_url') : $aGlobal['website']['blockexplorer']['url'] = 'http://explorer.litecoin.net/block/';
|
||||
$setting->getValue('website_chaininfo_url') ? $aGlobal['website']['chaininfo']['url'] = $setting->getValue('website_chaininfo_url') : $aGlobal['website']['chaininfo']['url'] = 'http://allchains.info';
|
||||
|
||||
@ -102,6 +104,7 @@ $aGlobal['statistics']['analytics']['code'] = $setting->getValue('statistics_ana
|
||||
$aGlobal['acl']['pool']['statistics'] = $setting->getValue('acl_pool_statistics');
|
||||
$aGlobal['acl']['block']['statistics'] = $setting->getValue('acl_block_statistics');
|
||||
$aGlobal['acl']['round']['statistics'] = $setting->getValue('acl_round_statistics');
|
||||
$aGlobal['acl']['blockfinder']['statistics'] = $setting->getValue('acl_blockfinder_statistics');
|
||||
$aGlobal['acl']['uptime']['statistics'] = $setting->getValue('acl_uptime_statistics');
|
||||
|
||||
// We don't want these session infos cached
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
|
||||
.icon-dollar:before { content: '\e818'; } /* '' */
|
||||
.icon-doc:before { content: '\e81b'; } /* '' */
|
||||
.icon-login:before { content: '\e81c'; } /* '' */
|
||||
.icon-exchange:before { content: '\e81a'; } /* '' */
|
||||
.icon-money:before { content: '\e819'; } /* '' */
|
||||
.icon-mail:before { content: '\e814'; } /* '' */
|
||||
@ -18,7 +19,7 @@
|
||||
.icon-bell:before { content: '\e817'; } /* '' */
|
||||
.icon-trash:before { content: '\e812'; } /* '' */
|
||||
.icon-cog:before { content: '\e810'; } /* '' */
|
||||
.icon-login:before { content: '\e81c'; } /* '' */
|
||||
.icon-search:before { content: '\e827'; } /* '' */
|
||||
.icon-resize-full-alt:before { content: '\e824'; } /* '' */
|
||||
.icon-down-open:before { content: '\e825'; } /* '' */
|
||||
.icon-left-open:before { content: '\e801'; } /* '' */
|
||||
|
||||
@ -12,6 +12,12 @@
|
||||
"code": 59416,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "7222571caa5c15f83dcfd447c58d68d9",
|
||||
"css": "search",
|
||||
"code": 59431,
|
||||
"src": "entypo"
|
||||
},
|
||||
{
|
||||
"uid": "a204f0fa972408eaae5a363c444991b2",
|
||||
"css": "login",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,6 +1,7 @@
|
||||
|
||||
.icon-dollar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-doc { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-exchange { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-money { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
@ -18,7 +19,7 @@
|
||||
.icon-bell { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-resize-full-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-down-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-left-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
|
||||
3
public/site_assets/mpos/css/fontello-ie7.css
vendored
3
public/site_assets/mpos/css/fontello-ie7.css
vendored
@ -12,6 +12,7 @@
|
||||
|
||||
.icon-dollar { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-doc { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-exchange { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-money { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-mail { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
@ -29,7 +30,7 @@
|
||||
.icon-bell { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-trash { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-login { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-search { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-resize-full-alt { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-down-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
.icon-left-open { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); }
|
||||
|
||||
15
public/site_assets/mpos/css/fontello.css
vendored
15
public/site_assets/mpos/css/fontello.css
vendored
@ -1,10 +1,10 @@
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.eot?25380644');
|
||||
src: url('../font/fontello.eot?25380644#iefix') format('embedded-opentype'),
|
||||
url('../font/fontello.woff?25380644') format('woff'),
|
||||
url('../font/fontello.ttf?25380644') format('truetype'),
|
||||
url('../font/fontello.svg?25380644#fontello') format('svg');
|
||||
src: url('../font/fontello.eot?43056661');
|
||||
src: url('../font/fontello.eot?43056661#iefix') format('embedded-opentype'),
|
||||
url('../font/fontello.woff?43056661') format('woff'),
|
||||
url('../font/fontello.ttf?43056661') format('truetype'),
|
||||
url('../font/fontello.svg?43056661#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@ -14,7 +14,7 @@
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.svg?25380644#fontello') format('svg');
|
||||
src: url('../font/fontello.svg?43056661#fontello') format('svg');
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -52,6 +52,7 @@
|
||||
|
||||
.icon-dollar:before { content: '\e818'; } /* '' */
|
||||
.icon-doc:before { content: '\e81b'; } /* '' */
|
||||
.icon-login:before { content: '\e81c'; } /* '' */
|
||||
.icon-exchange:before { content: '\e81a'; } /* '' */
|
||||
.icon-money:before { content: '\e819'; } /* '' */
|
||||
.icon-mail:before { content: '\e814'; } /* '' */
|
||||
@ -69,7 +70,7 @@
|
||||
.icon-bell:before { content: '\e817'; } /* '' */
|
||||
.icon-trash:before { content: '\e812'; } /* '' */
|
||||
.icon-cog:before { content: '\e810'; } /* '' */
|
||||
.icon-login:before { content: '\e81c'; } /* '' */
|
||||
.icon-search:before { content: '\e827'; } /* '' */
|
||||
.icon-resize-full-alt:before { content: '\e824'; } /* '' */
|
||||
.icon-down-open:before { content: '\e825'; } /* '' */
|
||||
.icon-left-open:before { content: '\e801'; } /* '' */
|
||||
|
||||
Binary file not shown.
@ -8,6 +8,7 @@
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="dollar" unicode="" d="m546 189q0-86-56-147t-144-77v-97q0-8-5-13t-13-5h-75q-7 0-13 5t-5 13v97q-37 5-71 18t-57 25t-41 26t-26 21t-10 10q-9 12-1 23l58 76q3 5 12 6q9 1 14-5l1-1q63-55 135-70q21-4 42-4q45 0 79 24t35 68q0 16-9 30t-18 23t-33 21t-37 18t-45 18q-21 9-34 14t-34 15t-35 17t-32 20t-29 24t-25 27t-20 32t-11 37t-5 44q0 77 55 135t142 75v100q0 7 5 13t13 5h75q8 0 13-5t5-13v-98q32-4 62-13t48-19t36-21t21-16t9-8q9-10 3-21l-46-81q-4-9-12-9q-8-2-16 4q-1 1-8 6t-21 15t-33 18t-42 15t-47 6q-53 0-87-24t-33-62q0-14 4-27t17-23t22-18t31-18t34-15t39-15q30-11 45-18t43-19t42-24t34-28t30-35t18-43t7-52z" horiz-adv-x="571.4" />
|
||||
<glyph glyph-name="doc" unicode="" d="m0-25l0 625q0 39 27 66t67 28l31 0l0 62q0 39 27 67t67 27l687 0q39 0 67-27t27-67l0-781q0-53-36-89t-89-36l-750 0q-53 0-89 36t-36 89z m63 0q0-25 18-44t44-19l750 0q25 0 44 19t18 44l0 781q0 14-8 23t-23 8l-687 0q-14 0-23-8t-8-23l0-750q0-13-9-22t-23-9t-22 9t-9 22l0 625l-31 0q-14 0-23-9t-8-22l0-625z m187 16q0 15 16 15l250 0q15 0 15-15t-15-16l-250 0q-16 0-16 16z m0 93q0 16 16 16l250 0q15 0 15-16t-15-15l-250 0q-16 0-16 15z m0 94q0 16 16 16l250 0q15 0 15-16q0-6-5-11t-10-4l-250 0q-16 0-16 15z m0 94q0 16 16 16l593 0q16 0 16-16t-16-16l-593 0q-16 0-16 16z m0 94q0 15 16 15l593 0q16 0 16-15t-16-16l-593 0q-16 0-16 16z m0 109l0 219q0 13 9 22t22 9l219 0q14 0 22-9t9-22l0-219q0-14-9-22t-22-9l-219 0q-13 0-22 9t-9 22z m63 31l156 0l0 156l-156 0l0-156z m281-515q0 15 15 15l250 0q16 0 16-15t-16-16l-250 0q-15 0-15 16z m0 93q0 16 15 16l250 0q16 0 16-16t-16-15l-250 0q-15 0-15 15z m0 94q0 16 15 16l250 0q16 0 16-16q0-6-5-11t-11-5l-250 0q-15 0-15 16z m0 281q0 16 15 16l250 0q16 0 16-16t-16-15l-250 0q-15 0-15 15z m0 94q0 16 15 16l250 0q16 0 16-16t-16-16l-250 0q-15 0-15 16z m0 94q0 15 15 15l250 0q16 0 16-15t-16-16l-250 0q-15 0-15 16z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="login" unicode="" d="m800 800q42 0 71-29t29-71l0-700q0-40-29-70t-71-30l-450 0q-40 0-69 30t-29 70l0 100l98 0l0-100l450 0l0 700l-450 0l0-150l-98 0l0 150q0 42 29 71t69 29l450 0z m-350-670l0 120l-450 0l0 150l450 0l0 120l200-194z" horiz-adv-x="900" />
|
||||
<glyph glyph-name="exchange" unicode="" d="m911 127l-670 0l0-111l-223 168l223 167l0-112l670 0l0-112z m-893 335l0 112l670 0l0 111l223-166l-223-168l0 111l-670 0z" horiz-adv-x="928" />
|
||||
<glyph glyph-name="money" unicode="" d="m238 378c13 16 35 21 65 24l0-85c-50 5-75 9-75 39c0 7 2 15 10 22z m107-241l0 91c59-5 78-9 78-35c0-30-24-49-78-56z m70 244c30-17 36-24 36-38l8-4l45 90l-6 5c-7-5-10-7-14-7s-8 0-13 4c-61 23-90 35-126 35l0 17c0 9 5 15 20 19l0 9l-79 0l0-9c14-4 17-11 17-19l0-15c-97-4-153-50-153-122c0-74 40-100 153-110l0-97c-78 8-117 38-117 64l-7 4l-41-94l6-4c6 4 9 5 12 5c2 0 7 0 9-2c48-24 94-38 138-40l0-19c0-10-3-16-17-20l0-9l79 0l0 9c-15 4-20 9-20 20l0 19c96 5 159 54 159 126c0 70-53 106-149 115l-10 0l0 88c23-2 46-8 70-20z m41 181c117-50 198-165 198-300c0-181-146-328-326-328c-182 0-328 147-328 328c0 135 81 250 198 300l-82 179c0 17 12 25 28 25l366 0c16 0 28-7 28-25z" horiz-adv-x="654" />
|
||||
<glyph glyph-name="mail" unicode="" d="m0-29l324 342l176-100l176 100l324-342l-1000 0z m0 114l0 414l254-147z m0 503l0 141l1000 0l0-141l-500-285z m746-236l254 147l0-414z" horiz-adv-x="1000" />
|
||||
@ -25,7 +26,7 @@
|
||||
<glyph glyph-name="bell" unicode="" d="m0 10l0 45l197 170l0 266q0 107 68 190t171 105l0 62l130 0l0-62q102-22 170-105t69-190l0-266l195-170l0-45l-1000 0z m428-87q0 30 21 52t52 21t52-21t21-52t-21-51t-52-20t-52 20t-21 51z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="trash" unicode="" d="m0 633l0 141l289 0l0 76l246 0l0-76l289 0l0-141l-824 0z m43-783l0 676l738 0l0-676l-738 0z" horiz-adv-x="824" />
|
||||
<glyph glyph-name="cog" unicode="" d="m0 272l0 156l150 16q14 45 38 88l-96 117l109 109l117-95q41 23 88 37l16 150l156 0l16-150q45-14 88-37l117 95l109-109l-96-117q24-43 38-88l150-16l0-156l-150-16q-14-47-38-88l96-117l-109-109l-117 96q-43-24-88-38l-16-150l-156 0l-16 150q-47 14-88 38l-117-96l-109 109l96 117q-24 41-38 88z m355 78q0-60 42-102t103-42t103 42t42 102t-42 103t-103 42t-103-42t-42-103z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="login" unicode="" d="m800 800q42 0 71-29t29-71l0-700q0-40-29-70t-71-30l-450 0q-40 0-69 30t-29 70l0 100l98 0l0-100l450 0l0 700l-450 0l0-150l-98 0l0 150q0 42 29 71t69 29l450 0z m-350-670l0 120l-450 0l0 150l450 0l0 120l200-194z" horiz-adv-x="900" />
|
||||
<glyph glyph-name="search" unicode="" d="m772 78q30-34 6-62l-46-46q-36-32-68 0l-190 190q-74-42-156-42q-128 0-223 95t-95 223t90 219t218 91t224-95t96-223q0-88-46-162z m-678 358q0-88 68-156t156-68t151 63t63 153q0 88-68 155t-156 67t-151-63t-63-151z" horiz-adv-x="789" />
|
||||
<glyph glyph-name="resize-full-alt" unicode="" d="m0-150l0 342l119-119l278 277l-276 275l-121-121l0 346l342 0l-119-119l277-277l275 275l-121 121l346 0l0-342l-119 119l-277-277l275-275l121 121l0-346l-342 0l119 119l-277 278l-275-276l121-121l-346 0z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="down-open" unicode="" d="m0 526l148 148l352-351l352 351l148-148l-352-352l-148-148l-148 148z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="left-open" unicode="" d="m0 350l148 149l352 351l148-148l-351-352l351-352l-148-148l-352 352z" horiz-adv-x="648" />
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
Binary file not shown.
@ -58,10 +58,10 @@
|
||||
<td class="center">{$USERS[user].id}</td>
|
||||
<td>{$USERS[user].username|escape}</td>
|
||||
<td>{$USERS[user].email|escape}</td>
|
||||
<td class="right">{$USERS[user].shares}</td>
|
||||
<td class="right">{$USERS[user].shares.valid}</td>
|
||||
<td class="right">{$USERS[user].hashrate}</td>
|
||||
<td class="right">{$USERS[user].payout.est_donation|number_format:"8"}</td>
|
||||
<td class="right">{$USERS[user].payout.est_payout|number_format:"8"}</td>
|
||||
<td class="right">{$USERS[user].estimates.donation|number_format:"8"}</td>
|
||||
<td class="right">{$USERS[user].estimates.payout|number_format:"8"}</td>
|
||||
<td class="right">{$USERS[user].balance|number_format:"8"}</td>
|
||||
<td class="center">
|
||||
<input type="hidden" name="admin[{$USERS[user].id}]" value="0"/>
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blocks">Block Stats</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=graphs">Hashrate Graphs</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round Stats</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blockfinder">Block Finder Stats</a></li>
|
||||
{if $GLOBAL.config.monitoring_uptimerobot_api_keys|default:"0"}<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime Stats</a></li>{/if}
|
||||
</ul>
|
||||
</li>
|
||||
@ -48,6 +49,9 @@
|
||||
{if $GLOBAL.acl.round.statistics}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round Stats</a></li>
|
||||
{/if}
|
||||
{if $GLOBAL.acl.blockfinder.statistics}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blockfinder">Block Finder Stats</a></li>
|
||||
{/if}
|
||||
{if $GLOBAL.acl.uptime.statistics}
|
||||
{if $GLOBAL.config.monitoring_uptimerobot_api_keys|default:"0"}<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime Stats</a></li>{/if}
|
||||
{/if}
|
||||
@ -55,11 +59,13 @@
|
||||
{/if}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=gettingstarted">Getting Started</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=support">Support</a></li>
|
||||
{if !$GLOBAL.website.about.disabled}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=about&action=pool">About</a>
|
||||
{/if}
|
||||
<ul>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=about&action=pool">This Pool</a></li>
|
||||
{if !$GLOBAL.website.api.disabled}<li><a href="{$smarty.server.PHP_SELF}?page=about&action=api">API Reference</a></li>{/if}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=about&action=donors">Pool Donors</a></li>
|
||||
{if !$GLOBAL.website.donors.disabled}<li><a href="{$smarty.server.PHP_SELF}?page=about&action=donors">Pool Donors</a></li>{/if}
|
||||
</ul>
|
||||
</li>
|
||||
{if $smarty.session.AUTHENTICATED|default == 1}<li><a href="{$smarty.server.PHP_SELF}?page=logout">Logout</a></li>{else}<li><a href="{$smarty.server.PHP_SELF}?page=register">Register</a></li>{/if}
|
||||
|
||||
4
public/templates/mmcFE/statistics/blockfinder/finder.tpl
Normal file
4
public/templates/mmcFE/statistics/blockfinder/finder.tpl
Normal file
@ -0,0 +1,4 @@
|
||||
{include file="statistics/blockfinder/finder_top.tpl"}
|
||||
{if $smarty.session.AUTHENTICATED|default}
|
||||
{include file="statistics/blockfinder/finder_own.tpl" ALIGN="right" SHORT=true}
|
||||
{/if}
|
||||
25
public/templates/mmcFE/statistics/blockfinder/finder_own.tpl
Normal file
25
public/templates/mmcFE/statistics/blockfinder/finder_own.tpl
Normal file
@ -0,0 +1,25 @@
|
||||
{include file="global/block_header.tpl" ALIGN="right" BLOCK_HEADER="Blocks found by own Workers"}
|
||||
<center>
|
||||
<table width="100%" border="0" style="font-size:13px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Rank</th>
|
||||
<th>Worker</th>
|
||||
<th align="center">Blocks</th>
|
||||
<th align="right" style="padding-right: 25px;">Coins Generated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{assign var=rank value=1}
|
||||
{section block $BLOCKSSOLVEDBYWORKER}
|
||||
<tr class="{cycle values="odd,even"}">
|
||||
<td align="center">{$rank++}</td>
|
||||
<td>{$BLOCKSSOLVEDBYWORKER[block].finder|default:"unknown/deleted"|escape}</td>
|
||||
<td align="center">{$BLOCKSSOLVEDBYWORKER[block].solvedblocks}</td>
|
||||
<td align="right" style="padding-right: 25px;">{$BLOCKSSOLVEDBYWORKER[block].generatedcoins|number_format}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
{include file="global/block_footer.tpl"}
|
||||
25
public/templates/mmcFE/statistics/blockfinder/finder_top.tpl
Normal file
25
public/templates/mmcFE/statistics/blockfinder/finder_top.tpl
Normal file
@ -0,0 +1,25 @@
|
||||
{include file="global/block_header.tpl" ALIGN="left" BLOCK_HEADER="Top 25 Blockfinder"}
|
||||
<center>
|
||||
<table width="100%" border="0" style="font-size:13px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Rank</th>
|
||||
<th>Username</th>
|
||||
<th align="center">Blocks</th>
|
||||
<th align="right" style="padding-right: 25px;">Coins Generated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{assign var=rank value=1}
|
||||
{section block $BLOCKSSOLVEDBYACCOUNT}
|
||||
<tr class="{cycle values="odd,even"}">
|
||||
<td align="center">{$rank++}</td>
|
||||
<td>{if $BLOCKSSOLVEDBYACCOUNT[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSSOLVEDBYACCOUNT[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td align="center">{$BLOCKSSOLVEDBYACCOUNT[block].solvedblocks}</td>
|
||||
<td align="right" style="padding-right: 25px;">{$BLOCKSSOLVEDBYACCOUNT[block].generatedcoins|number_format}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
{include file="global/block_footer.tpl"}
|
||||
0
public/templates/mpos/about/donors/disabled.tpl
Normal file
0
public/templates/mpos/about/donors/disabled.tpl
Normal file
0
public/templates/mpos/about/pool/disabled.tpl
Normal file
0
public/templates/mpos/about/pool/disabled.tpl
Normal file
@ -51,10 +51,10 @@
|
||||
<td align="center">{$USERS[user].id}</td>
|
||||
<td align="left">{$USERS[user].username|escape}</td>
|
||||
<td align="left">{$USERS[user].email|escape}</td>
|
||||
<td align="right">{$USERS[user].shares}</td>
|
||||
<td align="right">{$USERS[user].shares.valid}</td>
|
||||
<td align="right">{$USERS[user].hashrate}</td>
|
||||
<td align="right">{$USERS[user].payout.est_donation|number_format:"8"}</td>
|
||||
<td align="right">{$USERS[user].payout.est_payout|number_format:"8"}</td>
|
||||
<td align="right">{$USERS[user].estimates.donation|number_format:"8"}</td>
|
||||
<td align="right">{$USERS[user].estimates.payout|number_format:"8"}</td>
|
||||
<td align="right">{$USERS[user].balance|number_format:"8"}</td>
|
||||
<td align="center">
|
||||
<input type="hidden" name="admin[{$USERS[user].id}]" value="0"/>
|
||||
|
||||
@ -140,7 +140,7 @@ $(document).ready(function(){
|
||||
function refreshStaticData(data) {
|
||||
$('#b-confirmed').html(data.getdashboarddata.data.personal.balance.confirmed);
|
||||
$('#b-unconfirmed').html(data.getdashboarddata.data.personal.balance.unconfirmed);
|
||||
$('#b-price').html((parseFloat(data.getdashboarddata.data.pool.price).toFixed(4)));
|
||||
$('#b-price').html((parseFloat(data.getdashboarddata.data.pool.price).toFixed(8)));
|
||||
$('#b-dworkers').html(data.getdashboarddata.data.pool.workers);
|
||||
$('#b-hashrate').html((parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2)));
|
||||
$('#b-sharerate').html((parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2)));
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
<li class="icon-th-large"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blocks">Blocks</a></li>
|
||||
<li class="icon-chart"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=graphs">Graphs</a></li>
|
||||
<li class="icon-record"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round</a></li>
|
||||
<li class="icon-search"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blockfinder">Finder</a></li>
|
||||
{if $GLOBAL.config.monitoring_uptimerobot_api_keys|default:"0"}<li class="icon-bell"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime</a></li>{/if}
|
||||
</ul>
|
||||
{else}
|
||||
@ -49,6 +50,9 @@
|
||||
{if $GLOBAL.acl.round.statistics}
|
||||
<li class="icon-chart"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round</a></li>
|
||||
{/if}
|
||||
{if $GLOBAL.acl.blockfinder.statistics}
|
||||
<li class="icon-search"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blockfinder">Finder</a></li>
|
||||
{/if}
|
||||
{if $GLOBAL.acl.uptime.statistics}
|
||||
{if $GLOBAL.config.monitoring_uptimerobot_api_keys|default:"0"}<li class="icon-bell"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime</a></li>{/if}
|
||||
{/if}
|
||||
@ -57,8 +61,12 @@
|
||||
<h3>Help</h3>
|
||||
<ul class="toggle">
|
||||
<li class="icon-desktop"><a href="{$smarty.server.PHP_SELF}?page=gettingstarted">GettingStarted</a></li>
|
||||
{if !$GLOBAL.website.about.disabled}
|
||||
<li class="icon-doc"><a href="{$smarty.server.PHP_SELF}?page=about&action=pool">About</a></li>
|
||||
{/if}
|
||||
{if !$GLOBAL.website.donors.disabled}
|
||||
<li class="icon-money"><a href="{$smarty.server.PHP_SELF}?page=about&action=donors">Donors</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
<h3>Other</h3>
|
||||
<ul class="toggle">
|
||||
|
||||
4
public/templates/mpos/statistics/blockfinder/finder.tpl
Normal file
4
public/templates/mpos/statistics/blockfinder/finder.tpl
Normal file
@ -0,0 +1,4 @@
|
||||
{include file="statistics/blockfinder/finder_top.tpl"}
|
||||
{if $smarty.session.AUTHENTICATED|default}
|
||||
{include file="statistics/blockfinder/finder_own.tpl" ALIGN="right" SHORT=true}
|
||||
{/if}
|
||||
25
public/templates/mpos/statistics/blockfinder/finder_own.tpl
Normal file
25
public/templates/mpos/statistics/blockfinder/finder_own.tpl
Normal file
@ -0,0 +1,25 @@
|
||||
<article class="module width_half" style="min-height: 350px">
|
||||
<header><h3>Blocks found by own Workers</h3></header>
|
||||
<div>
|
||||
<table class="tablesorter" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Rank</th>
|
||||
<th>Worker</th>
|
||||
<th align="center">Blocks</th>
|
||||
<th align="right" style="padding-right: 25px;">Coins Generated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{assign var=rank value=1}
|
||||
{section block $BLOCKSSOLVEDBYWORKER}
|
||||
<tr class="{cycle values="odd,even"}">
|
||||
<td align="center">{$rank++}</td>
|
||||
<td>{$BLOCKSSOLVEDBYWORKER[block].finder|default:"unknown/deleted"|escape}</td>
|
||||
<td align="center">{$BLOCKSSOLVEDBYWORKER[block].solvedblocks}</td>
|
||||
<td align="right" style="padding-right: 25px;">{$BLOCKSSOLVEDBYWORKER[block].generatedcoins|number_format}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
25
public/templates/mpos/statistics/blockfinder/finder_top.tpl
Normal file
25
public/templates/mpos/statistics/blockfinder/finder_top.tpl
Normal file
@ -0,0 +1,25 @@
|
||||
<article class="module width_half" style="min-height: 350px">
|
||||
<header><h3>Top 25 Blockfinder</h3></header>
|
||||
<div>
|
||||
<table class="tablesorter" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Rank</th>
|
||||
<th>Username</th>
|
||||
<th align="center">Blocks</th>
|
||||
<th align="right" style="padding-right: 25px;">Coins Generated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{assign var=rank value=1}
|
||||
{section block $BLOCKSSOLVEDBYACCOUNT}
|
||||
<tr class="{cycle values="odd,even"}">
|
||||
<td align="center">{$rank++}</td>
|
||||
<td>{if $BLOCKSSOLVEDBYACCOUNT[block].is_anonymous|default:"0" == 1 && $GLOBAL.userdata.is_admin|default:"0" == 0}anonymous{else}{$BLOCKSSOLVEDBYACCOUNT[block].finder|default:"unknown"|escape}{/if}</td>
|
||||
<td align="center">{$BLOCKSSOLVEDBYACCOUNT[block].solvedblocks}</td>
|
||||
<td align="right" style="padding-right: 25px;">{$BLOCKSSOLVEDBYACCOUNT[block].generatedcoins|number_format}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
@ -40,6 +40,7 @@ CREATE TABLE IF NOT EXISTS `blocks` (
|
||||
`time` int(11) NOT NULL,
|
||||
`accounted` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`account_id` int(255) unsigned DEFAULT NULL,
|
||||
`worker_name` varchar(50) DEFAULT 'unknown',
|
||||
`shares` int(255) unsigned DEFAULT NULL,
|
||||
`share_id` int(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
|
||||
1
sql/004_blocks_worker.sql
Normal file
1
sql/004_blocks_worker.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE `blocks` ADD `worker_name` varchar(50) DEFAULT 'unknown' AFTER `account_id`;
|
||||
Loading…
Reference in New Issue
Block a user