diff --git a/.travis.yml b/.travis.yml index 274298ef..8747dad6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ before_script: - nohup php -S bone:8000 public/index.php & script: + - php vendor/bin/codecept build - php vendor/bin/codecept run unit --coverage --coverage-html --coverage-xml --env travis after_script: diff --git a/cronjobs/tables_cleanup.php b/cronjobs/tables_cleanup.php index b47918ae..c2f42780 100755 --- a/cronjobs/tables_cleanup.php +++ b/cronjobs/tables_cleanup.php @@ -59,7 +59,7 @@ if ($oToken->cleanupTokens()) { } $log->logInfo(sprintf($strLogMask, 'cleanupTokens', $affected, number_format(microtime(true) - $start, 3), $status, $message)); -// Clenaup shares archive +// Cleanup shares archive $start = microtime(true); $status = 'OK'; $message = ''; @@ -73,7 +73,7 @@ if ($affected === false) { } $log->logInfo(sprintf($strLogMask, 'purgeArchive', $affected, number_format(microtime(true) - $start, 3), $status, $message)); -// Clenaup shares archive +// Cleanup shares archive $start = microtime(true); $status = 'OK'; $message = ''; diff --git a/include/classes/csrftoken.class.php b/include/classes/csrftoken.class.php index 373a1210..130b4280 100644 --- a/include/classes/csrftoken.class.php +++ b/include/classes/csrftoken.class.php @@ -16,19 +16,22 @@ class CSRFToken Extends Base { } /** - * Returns +1 min and +1 hour rollovers hashes + * Returns +1 min up to +15 min rollovers hashes * @param string $user user or IP/host address * @param string $type page name or other unique per-page identifier - * @return array 1min and 1hour hashes + * @return array 1 minute ago up to 15 minute ago hashes */ + public function checkAdditional($user, $type) { $date = date('m/d/y/H/i'); $d = explode('/', $date); - // minute may have rolled over - $seed1 = $this->buildSeed($user.$type, $d[0], $d[1], $d[2], $d[3], ($d[4]-1)); - // hour may have rolled over - $seed2 = $this->buildSeed($user.$type, $d[0], $d[1], $d[2], ($d[3]-1), 59); - return array($this->getHash($seed1), $this->getHash($seed2)); + $hashes = array(); + for ($x = 1; $x < 16; $x++){ + for ($y = 4;$d[$y]-- == 0;$y--); + if ($d[4] < 0) { $d[4] = 59; } + $hashes[$x-1] = $this->getHash($this->buildSeed($user.$type, $d[0], $d[1], $d[2], $d[3], $d[4])); + } + return $hashes; } /** diff --git a/include/pages/api/getpoolstatus.inc.php b/include/pages/api/getpoolstatus.inc.php index 915132e0..dd48358f 100644 --- a/include/pages/api/getpoolstatus.inc.php +++ b/include/pages/api/getpoolstatus.inc.php @@ -12,7 +12,7 @@ $aLastBlock = $block->getLast(); // Efficiency $aShares = $statistics->getRoundShares(); -$aShares['valid'] > 0 ? $dEfficiency = round((100 - (100 / $aShares['valid'] * $aShares['invalid'])), 2) : $dEfficiency = 0; +$aShares['invalid'] > 0 ? $dEfficiency = round((1 - ($aShares['invalid'] / ($aShares['valid'] + $aShares['invalid']))) * 100, 2) : $dEfficiency = 100; // Fetch RPC data if ($bitcoin->can_connect() === true){ diff --git a/include/pages/api/getusertransactions.inc.php b/include/pages/api/getusertransactions.inc.php index 62f60e19..956ca668 100644 --- a/include/pages/api/getusertransactions.inc.php +++ b/include/pages/api/getusertransactions.inc.php @@ -8,13 +8,20 @@ $api->isActive(); $user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']); // Fetch transactions +if (isset($_REQUEST['start'])) { + $start = $_REQUEST['start']; +} else { + // start at the beginning + $start = 0; +} if (isset($_REQUEST['limit']) && $_REQUEST['limit'] <= 100) { $limit = $_REQUEST['limit']; } else { // Force limit $limit = 100; } -$data['transactions'] = $transaction->getTransactions(0, NULL, $limit, $user_id); + +$data['transactions'] = $transaction->getTransactions($start, NULL, $limit, $user_id); // Fetch summary if enabled if (!$setting->getValue('disable_transactionsummary')) { diff --git a/templates/bootstrap/admin/wallet/peers.tpl b/templates/bootstrap/admin/wallet/peers.tpl index 50770d3f..bccd331c 100644 --- a/templates/bootstrap/admin/wallet/peers.tpl +++ b/templates/bootstrap/admin/wallet/peers.tpl @@ -1,31 +1,35 @@ -
| Host | -Protocol | -Identity | -Connected | -Traffic | -
|---|---|---|---|---|
| {$ARRAY['addr']} | -{$ARRAY['version']} | -{$ARRAY['subver']|replace:'/':''} | -{$ARRAY['conntime']|date_format:$GLOBAL.config.date} | -{(($ARRAY['bytessent']|default:"0" + $ARRAY['bytesrecv']|default:"0") / 1024 / 1024)|number_format:"3"} MB | -
| Host | +Protocol | +Identity | +Connected | +Traffic | +
|---|---|---|---|---|
| {$ARRAY['addr']} | +{$ARRAY['version']} | +{$ARRAY['subver']|replace:'/':''} | +{$ARRAY['conntime']|date_format:$GLOBAL.config.date} | +{(($ARRAY['bytessent']|default:"0" + $ARRAY['bytesrecv']|default:"0") / 1024 / 1024)|number_format:"3"} MB | +
| Version | -Protocol Version | -Wallet Version | -Peers | -Status | -Blocks | -Accounts | - - -
|---|---|---|---|---|---|---|
| {$COININFO.version|default:""} | -{$COININFO.protocolversion|default:""} | -{$COININFO.walletversion|default:""} | -{$COININFO.connections|default:""} | -{$COININFO.errors|default:"OK"} | -{$COININFO.blocks|default:"0"} | -{$ADDRESSCOUNT} | -
| Version | +Protocol Version | +Wallet Version | +Peers | +Status | +Blocks | +Accounts | +
|---|---|---|---|---|---|---|
| {$COININFO.version|default:""} | +{$COININFO.protocolversion|default:""} | +{$COININFO.walletversion|default:""} | +{$COININFO.connections|default:""} | +{$COININFO.errors|default:"OK"} | +{$COININFO.blocks|default:"0"} | +{$ADDRESSCOUNT} | +
{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}
Est Next Difficulty{if $GLOBAL.nethashrate > 0}
Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}
Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}
Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}
{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}
Est Next Difficulty{if $GLOBAL.nethashrate > 0}
Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}
Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}
Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}
{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}
Est Next Difficulty{if $GLOBAL.nethashrate > 0}
Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}
Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}
Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}