decred: auto toggle ready flag with connection count

unlike other coins, decred ignore getblocktemplate error

This prevent miners to mine without possible reward in this special case.
This commit is contained in:
Tanguy Pruvot 2016-04-23 03:31:45 +02:00
parent 60e1938289
commit 0fd1d490df

View file

@ -87,6 +87,8 @@ function BackendCoinsUpdate()
$difficulty = $remote->getdifficulty();
if(is_array($difficulty))
$coin->rpcencoding = 'POS';
else if ($coin->symbol == 'DCR')
$coin->rpcencoding = 'DCR';
else
$coin->rpcencoding = 'POW';
}
@ -169,8 +171,9 @@ function BackendCoinsUpdate()
}
}
else if(strpos($remote->error, "not enough voters") || $coin->rpcencoding == 'DCR') {
// ignore temporary gbt errors, we use getwork
else if ($coin->rpcencoding == 'DCR')
{
$coin->auto_ready = ($coin->connections > 0);
}
else