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); +} +?>