we are getting this error
blockupdate.php(39): jsonRPCClient->__call('getblock', Array)
I've updated everything several times and still getting this error
Coin may be forked again since
http://107.170.47.66/ pool has 2/3 of network hashrate
Any ideas how to fix this?
I've encountered this before and I know how to fix it.
You have fixed the fork by deleting and redownloading the blockchain, right?
In that case, MPOS (blockupdate) tries to query the coin daemon about those orphaned blocks, but as they are in the old (now deleted) blockchain, coin daemon will just return error (no such block exist in its database).
You need to manually mark them as orphans (pool then stops trying to ask about them). This can be accomplished for example by fetching hashes of those blocks from the database and in blockupdate.php adding few lines of code that will mark them as orphan (solving all the necessary stuff in the process correctly, like setting transactions associated with that block as orphans, thus deducting them from possible payout, etc ...)
So fetch hashes of blocks from database:
select height,blockhash from blocks where height>=202 and height<=288;
and insert the code like this in the block cycle in blockupdate.php cronjob (right after the "foreach ($aAllBlocks as $iIndex => $aBlock)" as suggested here), with the hashes of corresponding blocks in place of these 6 that are here as an example:
foreach ($aAllBlocks as $iIndex => $aBlock) {
if ($aBlock['blockhash'] =='0000000001682879a3eb9633f52b5d3ab1e98da0e4c1f41ed3c5bc545043fc59'
|| $aBlock['blockhash'] =='000000000292950ef75c5df239bbf2ab1ffd6edbc979c0d3915d37a18dca18b6'
|| $aBlock['blockhash'] =='000000000769f427a8565f47064cc2f17d73ae276d1f1f0e3de1618b4342ff5a'
|| $aBlock['blockhash'] =='000000000f50519761bf3604eab652e8a914d5451ec13a915a902d80cf9cc987'
|| $aBlock['blockhash'] =='000000000e3278ae28ee2f3b68da5c376d4c40d079672669d35c71f41a6f4239'
|| $aBlock['blockhash'] =='0000000004e39755c35a7ec40b4ff7097bbaaf4c0c6aa17d49e67674d9dcac19'
) {
if ($block->setConfirmations($aBlock['id'], -1)) {
$log->logInfo(" Block marked as orphan");
} else {
$log->logError(" Block became orphaned but unable to update database entries");
}
continue;
}
// Fetch this blocks transaction details to find orphan blocks
Then just rerun the blockupdate cronjob - you may need to use -f if the job is marked as incomplete in the database (but verify that it is not actually runnig before that).
This should fix these block and once fixed, you can set modified blockupdate.php aside (what if another fork happens in the future? You may still need it
and replace it with original. Then your pool should start working again, resuming all the payments.
Also note:
Pool having 2/3 of network hashrate does not by itself cause a fork. If they are evil, they can do some double-spends or mine a bit more than their hashrate would allow, but such actions would be quite well detectable (and they risk compromising their reputation, etc ... ) - such attacks can produce some orphans, but is is not so easy to produce a fork.