Adding support for POS coin
This will fix #275 and add proper support for a different implementation of network difficulty.
This commit is contained in:
parent
4c04142f45
commit
af70a194c9
@ -32,6 +32,8 @@ if ($config['payout_system'] != 'pps') {
|
|||||||
// Fetch all transactions since our last block
|
// Fetch all transactions since our last block
|
||||||
if ( $bitcoin->can_connect() === true ){
|
if ( $bitcoin->can_connect() === true ){
|
||||||
$dDifficulty = $bitcoin->getdifficulty();
|
$dDifficulty = $bitcoin->getdifficulty();
|
||||||
|
if (strtolower($config['currency']) == 'pos')
|
||||||
|
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||||
} else {
|
} else {
|
||||||
verbose("Aborted: " . $bitcoin->can_connect() . "\n");
|
verbose("Aborted: " . $bitcoin->can_connect() . "\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
@ -10,8 +10,10 @@ $id = $user->checkApiKey($_REQUEST['api_key']);
|
|||||||
// Fetch data from litecoind
|
// Fetch data from litecoind
|
||||||
if ($bitcoin->can_connect() === true){
|
if ($bitcoin->can_connect() === true){
|
||||||
if (!$dDifficulty = $memcache->get('dDifficulty')) {
|
if (!$dDifficulty = $memcache->get('dDifficulty')) {
|
||||||
$memcache->set('dDifficulty', $dDifficulty);
|
|
||||||
$dDifficulty = $bitcoin->query('getdifficulty');
|
$dDifficulty = $bitcoin->query('getdifficulty');
|
||||||
|
if (strtolower($config['currency']) == 'pos')
|
||||||
|
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||||
|
$memcache->set('dDifficulty', $dDifficulty);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$iDifficulty = 1;
|
$iDifficulty = 1;
|
||||||
|
|||||||
@ -6,6 +6,8 @@ if (!defined('SECURITY'))
|
|||||||
|
|
||||||
if ($bitcoin->can_connect() === true){
|
if ($bitcoin->can_connect() === true){
|
||||||
$dDifficulty = $bitcoin->query('getdifficulty');
|
$dDifficulty = $bitcoin->query('getdifficulty');
|
||||||
|
if (strtolower($config['currency']) == 'pos')
|
||||||
|
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||||
$iBlock = $bitcoin->query('getblockcount');
|
$iBlock = $bitcoin->query('getblockcount');
|
||||||
} else {
|
} else {
|
||||||
$dDifficulty = 1;
|
$dDifficulty = 1;
|
||||||
|
|||||||
@ -7,6 +7,8 @@ if (!defined('SECURITY'))
|
|||||||
// Fetch data from litecoind
|
// Fetch data from litecoind
|
||||||
if ($bitcoin->can_connect() === true){
|
if ($bitcoin->can_connect() === true){
|
||||||
$dDifficulty = $bitcoin->getdifficulty();
|
$dDifficulty = $bitcoin->getdifficulty();
|
||||||
|
if (strtolower($config['currency']) == 'pos')
|
||||||
|
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||||
$iBlock = $bitcoin->getblockcount();
|
$iBlock = $bitcoin->getblockcount();
|
||||||
} else {
|
} else {
|
||||||
$dDifficulty = 1;
|
$dDifficulty = 1;
|
||||||
|
|||||||
@ -14,8 +14,11 @@ $aRoundShares = 1;
|
|||||||
// Only run these if the user is logged in
|
// Only run these if the user is logged in
|
||||||
if (@$_SESSION['AUTHENTICATED']) {
|
if (@$_SESSION['AUTHENTICATED']) {
|
||||||
$aRoundShares = $statistics->getRoundShares();
|
$aRoundShares = $statistics->getRoundShares();
|
||||||
if ($bitcoin->can_connect() === true)
|
if ($bitcoin->can_connect() === true) {
|
||||||
$dDifficulty = $bitcoin->query('getdifficulty');
|
$dDifficulty = $bitcoin->query('getdifficulty');
|
||||||
|
if (strtolower($config['currency']) == 'pos')
|
||||||
|
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch some data
|
// Fetch some data
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user