Skip to content

Commit 6c0d9a1

Browse files
authored
Merge pull request #2676 from smiba/development-patch-1
Expend CSRF token expiry & Est. Diff for constantly changing coins
2 parents ae337b4 + f0f4e00 commit 6c0d9a1

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

cronjobs/tables_cleanup.php

+2-2
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

+10-7
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
/**

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

+1-1
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

+1-1
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

+1-1
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)