Merge pull request #304 from TheSerapher/issue-275-pos-support

Issue 275 pos support
This commit is contained in:
Sebastian Grewe 2013-07-01 01:38:34 -07:00
commit f333982698
5 changed files with 13 additions and 2 deletions

View File

@ -32,6 +32,8 @@ if ($config['payout_system'] != 'pps') {
// Fetch all transactions since our last block
if ( $bitcoin->can_connect() === true ){
$dDifficulty = $bitcoin->getdifficulty();
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
} else {
verbose("Aborted: " . $bitcoin->can_connect() . "\n");
exit(1);

View File

@ -10,8 +10,10 @@ $id = $user->checkApiKey($_REQUEST['api_key']);
// Fetch data from litecoind
if ($bitcoin->can_connect() === true){
if (!$dDifficulty = $memcache->get('dDifficulty')) {
$memcache->set('dDifficulty', $dDifficulty);
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
$memcache->set('dDifficulty', $dDifficulty);
}
} else {
$iDifficulty = 1;

View File

@ -6,6 +6,8 @@ if (!defined('SECURITY'))
if ($bitcoin->can_connect() === true){
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
$iBlock = $bitcoin->query('getblockcount');
} else {
$dDifficulty = 1;

View File

@ -7,6 +7,8 @@ if (!defined('SECURITY'))
// Fetch data from litecoind
if ($bitcoin->can_connect() === true){
$dDifficulty = $bitcoin->getdifficulty();
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
$iBlock = $bitcoin->getblockcount();
} else {
$dDifficulty = 1;

View File

@ -14,8 +14,11 @@ $aRoundShares = 1;
// Only run these if the user is logged in
if (@$_SESSION['AUTHENTICATED']) {
$aRoundShares = $statistics->getRoundShares();
if ($bitcoin->can_connect() === true)
if ($bitcoin->can_connect() === true) {
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
}
}
// Fetch some data