mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-23 20:00:42 +00:00
backend: auto stop mining at pow end & fill mature_blocks
This commit is contained in:
parent
f31dd15d4e
commit
81518c4c7d
2 changed files with 12 additions and 0 deletions
|
@ -44,6 +44,11 @@ function BackendBlockNew($coin, $db_block)
|
|||
{
|
||||
$earning->mature_time = time();
|
||||
$earning->status = 1;
|
||||
// auto update mature_blocks
|
||||
if ($db_block->confirmations < $coin->mature_blocks || !intval($coin->mature_blocks)) {
|
||||
$coin->mature_blocks = $db_block->confirmations;
|
||||
$coin->save();
|
||||
}
|
||||
}
|
||||
else // immature
|
||||
$earning->status = 0;
|
||||
|
|
|
@ -232,6 +232,13 @@ function BackendCoinsUpdate()
|
|||
$coin->version = $info['version'];
|
||||
$coin->block_height = $info['blocks'];
|
||||
|
||||
if($coin->powend_height > 0 && $coin->block_height > $coin->powend_height) {
|
||||
if ($coin->auto_ready) {
|
||||
$coin->auto_ready = false;
|
||||
$coin->errors = 'PoW end reached';
|
||||
}
|
||||
}
|
||||
|
||||
$coin->save();
|
||||
// debuglog(" end $coin->name");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue