Skip to content

Commit 467f8e5

Browse files
committed
Merge branch 'development' of https://github.com/MPOS/php-mpos into development
2 parents 64924ec + 145304b commit 467f8e5

File tree

12 files changed

+103
-85
lines changed

12 files changed

+103
-85
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ before_script:
3434
- nohup php -S bone:8000 public/index.php &
3535

3636
script:
37+
- php vendor/bin/codecept build
3738
- php vendor/bin/codecept run unit --coverage --coverage-html --coverage-xml --env travis
3839

3940
after_script:

cronjobs/tables_cleanup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
}
6060
$log->logInfo(sprintf($strLogMask, 'cleanupTokens', $affected, number_format(microtime(true) - $start, 3), $status, $message));
6161

62-
// Clenaup shares archive
62+
// Cleanup shares archive
6363
$start = microtime(true);
6464
$status = 'OK';
6565
$message = '';
@@ -73,7 +73,7 @@
7373
}
7474
$log->logInfo(sprintf($strLogMask, 'purgeArchive', $affected, number_format(microtime(true) - $start, 3), $status, $message));
7575

76-
// Clenaup shares archive
76+
// Cleanup shares archive
7777
$start = microtime(true);
7878
$status = 'OK';
7979
$message = '';

include/classes/csrftoken.class.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,22 @@ public function getBasic($user, $type) {
1616
}
1717

1818
/**
19-
* Returns +1 min and +1 hour rollovers hashes
19+
* Returns +1 min up to +15 min rollovers hashes
2020
* @param string $user user or IP/host address
2121
* @param string $type page name or other unique per-page identifier
22-
* @return array 1min and 1hour hashes
22+
* @return array 1 minute ago up to 15 minute ago hashes
2323
*/
24+
2425
public function checkAdditional($user, $type) {
2526
$date = date('m/d/y/H/i');
2627
$d = explode('/', $date);
27-
// minute may have rolled over
28-
$seed1 = $this->buildSeed($user.$type, $d[0], $d[1], $d[2], $d[3], ($d[4]-1));
29-
// hour may have rolled over
30-
$seed2 = $this->buildSeed($user.$type, $d[0], $d[1], $d[2], ($d[3]-1), 59);
31-
return array($this->getHash($seed1), $this->getHash($seed2));
28+
$hashes = array();
29+
for ($x = 1; $x < 16; $x++){
30+
for ($y = 4;$d[$y]-- == 0;$y--);
31+
if ($d[4] < 0) { $d[4] = 59; }
32+
$hashes[$x-1] = $this->getHash($this->buildSeed($user.$type, $d[0], $d[1], $d[2], $d[3], $d[4]));
33+
}
34+
return $hashes;
3235
}
3336

3437
/**

include/pages/api/getpoolstatus.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// Efficiency
1414
$aShares = $statistics->getRoundShares();
15-
$aShares['valid'] > 0 ? $dEfficiency = round((100 - (100 / $aShares['valid'] * $aShares['invalid'])), 2) : $dEfficiency = 0;
15+
$aShares['invalid'] > 0 ? $dEfficiency = round((1 - ($aShares['invalid'] / ($aShares['valid'] + $aShares['invalid']))) * 100, 2) : $dEfficiency = 100;
1616

1717
// Fetch RPC data
1818
if ($bitcoin->can_connect() === true){

include/pages/api/getusertransactions.inc.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@
88
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);
99

1010
// Fetch transactions
11+
if (isset($_REQUEST['start'])) {
12+
$start = $_REQUEST['start'];
13+
} else {
14+
// start at the beginning
15+
$start = 0;
16+
}
1117
if (isset($_REQUEST['limit']) && $_REQUEST['limit'] <= 100) {
1218
$limit = $_REQUEST['limit'];
1319
} else {
1420
// Force limit
1521
$limit = 100;
1622
}
17-
$data['transactions'] = $transaction->getTransactions(0, NULL, $limit, $user_id);
23+
24+
$data['transactions'] = $transaction->getTransactions($start, NULL, $limit, $user_id);
1825

1926
// Fetch summary if enabled
2027
if (!$setting->getValue('disable_transactionsummary')) {
Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
1-
<div class="row">
2-
<div class="col-lg-12">
3-
<div class="panel panel-info">
4-
<div class="panel-heading">
5-
<i class="fa fa-connectdevelop fa-fw"></i> Peer Information
6-
</div>
7-
<div class="panel-body no-padding">
8-
<table class="table table-striped table-bordered table-hover">
9-
<thead>
10-
<tr>
11-
<th>Host</th>
12-
<th>Protocol</th>
13-
<th>Identity</th>
14-
<th>Connected</th>
15-
<th>Traffic</th>
16-
</tr>
17-
</thead>
18-
<tbody>
19-
{foreach key=KEY item=ARRAY from=$PEERINFO}
20-
<tr>
21-
<td>{$ARRAY['addr']}</td>
22-
<td>{$ARRAY['version']}</td>
23-
<td>{$ARRAY['subver']|replace:'/':''}</td>
24-
<td>{$ARRAY['conntime']|date_format:$GLOBAL.config.date}</td>
25-
<td>{(($ARRAY['bytessent']|default:"0" + $ARRAY['bytesrecv']|default:"0") / 1024 / 1024)|number_format:"3"} MB</td>
26-
</tr>
27-
{/foreach}
28-
</tbody>
29-
</table>
30-
</div>
31-
</div>
1+
<div class="row">
2+
<div class="col-lg-12">
3+
<div class="panel panel-info">
4+
<div class="panel-heading">
5+
<i class="fa fa-connectdevelop fa-fw"></i> Peer Information
6+
</div>
7+
<div class="panel-body no-padding">
8+
<div class="table-responsive">
9+
<table class="table table-striped table-bordered table-hover">
10+
<thead>
11+
<tr>
12+
<th>Host</th>
13+
<th>Protocol</th>
14+
<th>Identity</th>
15+
<th>Connected</th>
16+
<th>Traffic</th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
{foreach key=KEY item=ARRAY from=$PEERINFO}
21+
<tr>
22+
<td>{$ARRAY['addr']}</td>
23+
<td>{$ARRAY['version']}</td>
24+
<td>{$ARRAY['subver']|replace:'/':''}</td>
25+
<td>{$ARRAY['conntime']|date_format:$GLOBAL.config.date}</td>
26+
<td>{(($ARRAY['bytessent']|default:"0" + $ARRAY['bytesrecv']|default:"0") / 1024 / 1024)|number_format:"3"} MB</td>
27+
</tr>
28+
{/foreach}
29+
</tbody>
30+
</table>
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
</div>
Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
<div class="col-lg-8">
2-
<div class="panel panel-info">
3-
<div class="panel-heading">
4-
<i class="fa fa-info fa-fw"></i> Wallet Status
5-
</div>
6-
<div class="panel-body no-padding">
7-
<table class="table table-striped table-bordered table-hover">
8-
<thead>
9-
<th>Version</th>
10-
<th>Protocol Version</th>
11-
<th>Wallet Version</th>
12-
<th>Peers</th>
13-
<th>Status</th>
14-
<th>Blocks</th>
15-
<th>Accounts</th>
16-
</thead>
17-
<tbody>
18-
<tr>
19-
<td>{$COININFO.version|default:""}</td>
20-
<td>{$COININFO.protocolversion|default:""}</td>
21-
<td>{$COININFO.walletversion|default:""}</td>
22-
<td>{$COININFO.connections|default:""}</td>
23-
<td><font color="{if $COININFO.errors}red{else}green{/if}">{$COININFO.errors|default:"OK"}</font></td>
24-
<td>{$COININFO.blocks|default:"0"}</td>
25-
<td>{$ADDRESSCOUNT}</td>
26-
</tr>
27-
</tbody>
28-
</table>
29-
</div>
30-
</div>
31-
</div>
32-
</div>
1+
<div class="col-lg-8">
2+
<div class="panel panel-info">
3+
<div class="panel-heading">
4+
<i class="fa fa-info fa-fw"></i> Wallet Status
5+
</div>
6+
<div class="panel-body no-padding">
7+
<div class="table-responsive">
8+
<table class="table table-striped table-bordered table-hover">
9+
<thead>
10+
<tr>
11+
<th>Version</th>
12+
<th>Protocol Version</th>
13+
<th>Wallet Version</th>
14+
<th>Peers</th>
15+
<th>Status</th>
16+
<th>Blocks</th>
17+
<th>Accounts</th>
18+
</tr>
19+
</thead>
20+
<tbody>
21+
<tr>
22+
<td>{$COININFO.version|default:""}</td>
23+
<td>{$COININFO.protocolversion|default:""}</td>
24+
<td>{$COININFO.walletversion|default:""}</td>
25+
<td>{$COININFO.connections|default:""}</td>
26+
<td><font color="{if $COININFO.errors}red{else}green{/if}">{$COININFO.errors|default:"OK"}</font></td>
27+
<td>{$COININFO.blocks|default:"0"}</td>
28+
<td>{$ADDRESSCOUNT}</td>
29+
</tr>
30+
</tbody>
31+
</table>
32+
</div>
33+
</div>
34+
</div>
35+
</div>

templates/bootstrap/dashboard/round_statistics/pplns/round.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<p class="h5" id="b-nextdiff">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
7171
</div>
7272
<div class="circle-tile-number text-faded">
73-
<p class="h6">Est Next Difficulty{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
73+
<p class="h6">Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}</p>
7474
</div>
7575
</div>
7676
</div>

templates/bootstrap/dashboard/round_statistics/pps/round.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<p id="b-nextdiff" class="h5">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
131131
</div>
132132
<div class="circle-tile-number text-faded">
133-
<p class="h6">Est Next Difficulty{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
133+
<p class="h6">Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}</p>
134134
</div>
135135
</div>
136136
</div>

templates/bootstrap/dashboard/round_statistics/prop/round.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<p class="h5" id="b-nextdiff">{if $GLOBAL.nethashrate > 0}{$NETWORK.EstNextDifficulty|number_format:"8"}{else}n/a{/if}</p>
7171
</div>
7272
<div class="circle-tile-number text-faded">
73-
<p class="h6">Est Next Difficulty{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}</p>
73+
<p class="h6">Est. Next Difficulty{if $GLOBAL.config.coindiffchangetarget > 1}{if $GLOBAL.nethashrate > 0}<br/>Change in {$NETWORK.BlocksUntilDiffChange} Blocks{else}No Estimates{/if}{/if}</p>
7474
</div>
7575
</div>
7676
</div>

0 commit comments

Comments
 (0)