From aac80502e18219c6e0ce6f71c28320a426a8e885 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 28 Feb 2014 09:09:29 +0100 Subject: [PATCH 1/3] [FIX] Bail findblocks on block insertion errors Fixes #1857 once merged. --- cronjobs/findblock.php | 4 ++-- public/include/config/error_codes.inc.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cronjobs/findblock.php b/cronjobs/findblock.php index 0c8dfeca..4ee9f644 100755 --- a/cronjobs/findblock.php +++ b/cronjobs/findblock.php @@ -25,7 +25,6 @@ chdir(dirname(__FILE__)); // Include all settings and classes require_once('shared.inc.php'); - // Fetch our last block found from the DB as a starting point $aLastBlock = @$block->getLast(); $strLastBlockHash = $aLastBlock['blockhash']; @@ -66,7 +65,8 @@ if (empty($aTransactions['transactions'])) { continue; } if (!$block->addBlock($aData) ) { - $log->logFatal('Unable to add block: ' . $aData['height'] . ': ' . $block->getCronError()); + $log->logFatal('Unable to add block: (' . $aData['height'] . ') ' . $aData['blockhash'] . ': ' . $block->getCronError()); + $monitoring->endCronjob($cron_name, 'E0081', 1, true); } } } diff --git a/public/include/config/error_codes.inc.php b/public/include/config/error_codes.inc.php index d8be9eb3..b6e720ee 100644 --- a/public/include/config/error_codes.inc.php +++ b/public/include/config/error_codes.inc.php @@ -76,4 +76,5 @@ $aErrorCodes['E0077'] = 'RPC method or connection failed'; $aErrorCodes['E0078'] = 'RPC method did not return 200 OK'; $aErrorCodes['E0079'] = 'Wallet does not cover payouts total amount'; $aErrorCodes['E0080'] = 'No new unaccounted shares since last run'; +$aErrorCodes['E0081'] = 'Failed to insert new block into database'; ?> From ddcc8df067a197406f61025b0d14b7c21751316e Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Fri, 28 Feb 2014 12:00:11 +0100 Subject: [PATCH 2/3] [UPDATE] site specific files --- .gitignore | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7b3e7736..67ef85d9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,8 @@ public/include/config/global.inc.sha.php .settings # Site specific Files -robots.txt -sitemap.xml -sitemap.gz -sitemap.tar.gz +/public/robots.txt +/public/sitemap.xml +/public/sitemap.gz +/public/sitemap.tar.gz +/public/.htaccess From 4d2606bedc5e168495935bf56db1d0f30267e41d Mon Sep 17 00:00:00 2001 From: Contex Date: Fri, 28 Feb 2014 21:09:28 +0100 Subject: [PATCH 3/3] Fixed table cells for general_stats.tpl is obviously wrong --- .../mpos/statistics/pool/general_stats.tpl | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/templates/mpos/statistics/pool/general_stats.tpl b/public/templates/mpos/statistics/pool/general_stats.tpl index 7506f013..4ac58bb6 100644 --- a/public/templates/mpos/statistics/pool/general_stats.tpl +++ b/public/templates/mpos/statistics/pool/general_stats.tpl @@ -8,15 +8,15 @@ {$GLOBAL.hashrate|number_format:"3"} {$GLOBAL.hashunits.pool} - Pool Efficiency + Pool Efficiency {if $GLOBAL.roundshares.valid > 0}{($GLOBAL.roundshares.valid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%{else}0%{/if} - Current Active Workers + Current Active Workers {$GLOBAL.workers} - Current Difficulty + Current Difficulty {if ! $GLOBAL.website.chaininfo.disabled} {$NETWORK.difficulty} {else} @@ -24,7 +24,7 @@ {/if} - Est. Next Difficulty + Est. Next Difficulty {if ! $GLOBAL.website.chaininfo.disabled} {$NETWORK.EstNextDifficulty} (Change in {$NETWORK.BlocksUntilDiffChange} Blocks) {else} @@ -32,34 +32,34 @@ {/if} - Est. Avg. Time per Round (Network) + Est. Avg. Time per Round (Network) {$NETWORK.EstTimePerBlock|seconds_to_words} - Est. Avg. Time per Round (Pool) + Est. Avg. Time per Round (Pool) {$ESTTIME|seconds_to_words} - Est. Shares this Round + Est. Shares this Round {$ESTIMATES.shares} (done: {$ESTIMATES.percent}%) {if ! $GLOBAL.website.blockexplorer.disabled} - Next Network Block + Next Network Block {$CURRENTBLOCK + 1}    (Current: {$CURRENTBLOCK}) {else} - Next Network Block + Next Network Block {$CURRENTBLOCK + 1}    (Current: {$CURRENTBLOCK}) {/if} - Last Block Found + Last Block Found {$LASTBLOCK|default:"0"} - Time Since Last Block + Time Since Last Block {$TIMESINCELAST|seconds_to_words}