sort output of blocked list by block timestamp

This commit is contained in:
Brian Quinion
2012-12-08 17:58:24 +00:00
parent a723b94291
commit 02e7cfd6f4
2 changed files with 16 additions and 5 deletions

View File

@@ -994,6 +994,15 @@
return $iMaxVal;
}
function byLastBlockTime($a, $b)
{
if ($a['lastBlockTimestamp'] == $b['lastBlockTimestamp'])
{
return 0;
}
return ($a['lastBlockTimestamp'] > $b['lastBlockTimestamp']) ? -1 : 1;
}
function getBucketBlocks()
{
$m = getBucketMemcache();
@@ -1014,6 +1023,7 @@
'currentlyBlocked' => $iCurrentBucketSize + (CONST_ConnectionBucket_Cost_Reverse) >= CONST_ConnectionBucket_BlockLimit,
);
}
uasort($aBlockedList, 'byLastBlockTime');
return $aBlockedList;
}