mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-03 12:30:07 +00:00
decred: detect generated blocks + stratum fix
backend: generated blocks were not auto detected (to double check) stratum: seen on a new setup, if dcrd doesnt have --miningaddr set stratum is not able to distribute jobs and was crashing
This commit is contained in:
parent
cc364febfc
commit
e2f982300c
2 changed files with 6 additions and 3 deletions
|
@ -140,6 +140,8 @@ static bool job_assign_client(YAAMP_JOB *job, YAAMP_CLIENT *client, double maxha
|
||||||
|
|
||||||
void job_assign_clients(YAAMP_JOB *job, double maxhash)
|
void job_assign_clients(YAAMP_JOB *job, double maxhash)
|
||||||
{
|
{
|
||||||
|
if (!job) return;
|
||||||
|
|
||||||
job->speed = 0;
|
job->speed = 0;
|
||||||
job->count = 0;
|
job->count = 0;
|
||||||
|
|
||||||
|
|
|
@ -168,15 +168,15 @@ function BackendBlockFind2()
|
||||||
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
|
$remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport);
|
||||||
|
|
||||||
$mostrecent = 0;
|
$mostrecent = 0;
|
||||||
if($coin->lastblock == null) $coin->lastblock = '';
|
if(empty($coin->lastblock)) $coin->lastblock = '';
|
||||||
$list = $remote->listsinceblock($coin->lastblock);
|
$list = $remote->listsinceblock($coin->lastblock);
|
||||||
if(!$list) continue;
|
if(!$list) continue;
|
||||||
|
|
||||||
// debuglog("find2 $coin->symbol");
|
// debuglog("find2 $coin->symbol");
|
||||||
foreach($list['transactions'] as $transaction)
|
foreach($list['transactions'] as $transaction)
|
||||||
{
|
{
|
||||||
if($transaction['time'] > time() - 5*60) continue;
|
|
||||||
if(!isset($transaction['blockhash'])) continue;
|
if(!isset($transaction['blockhash'])) continue;
|
||||||
|
if($transaction['time'] > time() - 5*60) continue;
|
||||||
|
|
||||||
if($transaction['time'] > $mostrecent)
|
if($transaction['time'] > $mostrecent)
|
||||||
{
|
{
|
||||||
|
@ -192,7 +192,8 @@ function BackendBlockFind2()
|
||||||
$db_block = getdbosql('db_blocks', "blockhash='{$transaction['blockhash']}' OR height={$blockext['height']}");
|
$db_block = getdbosql('db_blocks', "blockhash='{$transaction['blockhash']}' OR height={$blockext['height']}");
|
||||||
if($db_block) continue;
|
if($db_block) continue;
|
||||||
|
|
||||||
// debuglog("adding lost block $coin->name {$blockext['height']}");
|
if ($coin->symbol == 'DCR')
|
||||||
|
debuglog("{$coin->name} generated block {$blockext['height']} detected!");
|
||||||
|
|
||||||
$db_block = new db_blocks;
|
$db_block = new db_blocks;
|
||||||
$db_block->blockhash = $transaction['blockhash'];
|
$db_block->blockhash = $transaction['blockhash'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue