From a9b56433cb2fb3a60d09f08635fb111f90a7608d Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 3 Feb 2014 08:16:02 +0100 Subject: [PATCH] [ADDED] 51 Percent Script --- scripts/51_percent_check.php | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 scripts/51_percent_check.php diff --git a/scripts/51_percent_check.php b/scripts/51_percent_check.php new file mode 100755 index 00000000..d497156e --- /dev/null +++ b/scripts/51_percent_check.php @@ -0,0 +1,44 @@ +#!/usr/bin/php +getnetworkhashps(); +$dPoolHashrate = $statistics->getCurrentHashrate(); +$iPercentage = round(100 / $dNetworkHashrate * $dPoolHashrate, 0); + +if ($iPercentage >= 51) { + echo 'Your pool has ' . $iPercentage . '% of the network hashrate. Registrations will be disabled.' . PHP_EOL; + $setting->setValue('lock_registration', 1); +} else { + $setting->setValue('lock_registration', 0); +} +?>