Merge pull request #1974 from MPOS/coin-pps-value
[ADDED] Calc Coin PPS Value Method
This commit is contained in:
commit
2c3ae28fca
@ -63,7 +63,7 @@ if ($config['pps']['reward']['type'] == 'blockavg' && $block->getBlockCount() >
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Per-share value to be paid out to users
|
// Per-share value to be paid out to users
|
||||||
$pps_value = round($pps_reward / (pow(2, $coin->getTargetBits()) * $dDifficulty), 12);
|
$pps_value = round($coin->calcPPSValue($pps_reward, $dDifficulty), 12);
|
||||||
|
|
||||||
// Find our last share accounted and last inserted share for PPS calculations
|
// Find our last share accounted and last inserted share for PPS calculations
|
||||||
if (!$iPreviousShareId = $setting->getValue('pps_last_share_id')) {
|
if (!$iPreviousShareId = $setting->getValue('pps_last_share_id')) {
|
||||||
|
|||||||
@ -19,6 +19,14 @@ class CoinBase extends Base {
|
|||||||
return $this->target_bits;
|
return $this->target_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the PPS value for this coin
|
||||||
|
* WARNING: Get this wrong and you will over- or underpay your miners!
|
||||||
|
**/
|
||||||
|
public function calcPPSValue($pps_reward, $dDifficulty) {
|
||||||
|
return ($pps_reward / (pow(2, $this->target_bits) * $dDifficulty));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate our hashrate based on shares inserted to DB
|
* Calculate our hashrate based on shares inserted to DB
|
||||||
* We use diff1 share values, not a baseline one
|
* We use diff1 share values, not a baseline one
|
||||||
|
|||||||
@ -892,7 +892,7 @@ class Statistics extends Base {
|
|||||||
$pps_reward = $this->config['pps']['reward']['default'];
|
$pps_reward = $this->config['pps']['reward']['default'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return round($pps_reward / (pow(2, $this->coin->getTargetBits()) * $dDifficulty), 12);
|
return round($this->coin->calcPPSValue($pps_reward, $dDifficulty), 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user