From d2c6422f3d063fbd52c1d356e5a41ddd82b2391b Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 18 Jun 2013 10:41:11 +0200 Subject: [PATCH] Payout Systems should check for activation * Check if configuration is setup to run a specific payout system * Added all payout systems to cron script Fixes #210 --- cronjobs/pps_payout.php | 7 +++++++ cronjobs/proportional_payout.php | 6 ++++++ cronjobs/run-crons.sh | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cronjobs/pps_payout.php b/cronjobs/pps_payout.php index 06d4f3b4..459384d2 100755 --- a/cronjobs/pps_payout.php +++ b/cronjobs/pps_payout.php @@ -22,6 +22,13 @@ limitations under the License. // Include all settings and classes require_once('shared.inc.php'); + +// Check if we are set as the payout system +if ($config['payout_system'] != 'pps') { + verbose("Please activate this cron in configuration via payout_system = pps\n"); + exit(0); +} + // Fetch all transactions since our last block if ( $bitcoin->can_connect() === true ){ $dDifficulty = $bitcoin->getdifficulty(); diff --git a/cronjobs/proportional_payout.php b/cronjobs/proportional_payout.php index e99387f2..61092006 100755 --- a/cronjobs/proportional_payout.php +++ b/cronjobs/proportional_payout.php @@ -22,6 +22,12 @@ limitations under the License. // Include all settings and classes require_once('shared.inc.php'); +// Check if we are set as the payout system +if ($config['payout_system'] != 'prop') { + verbose("Please activate this cron in configuration via payout_system = prop\n"); + exit(0); +} + // Fetch all unaccounted blocks $aAllBlocks = $block->getAllUnaccounted('ASC'); if (empty($aAllBlocks)) { diff --git a/cronjobs/run-crons.sh b/cronjobs/run-crons.sh index f5cbaee7..c9dfd949 100755 --- a/cronjobs/run-crons.sh +++ b/cronjobs/run-crons.sh @@ -16,7 +16,7 @@ PIDFILE='/tmp/mmcfe-ng-cron.pid' CRONHOME='.' # List of cruns to execute -CRONS="findblock.php proportional_payout.php blockupdate.php auto_payout.php tickerupdate.php notifications.php statistics.php" +CRONS="findblock.php proportional_payout.php pps_payout.php blockupdate.php auto_payout.php tickerupdate.php notifications.php statistics.php" # Additional arguments to pass to cronjobs CRONARGS="-v"