From a083b1c272def47496a3e90e8bda390f4f6c72d6 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Fri, 14 Feb 2014 11:39:11 +0100 Subject: [PATCH] [REMOVED] Liquid Payout cron due to issues Payouts did not work very well and caused more issues for pools than being worth having this cron. We revert this and let them use sendtoaddress again whenever they wish to deduct payouts from their pool at their own discretion. We may add this thing back in sometime later with a proper and working implementation but no promises. --- cronjobs/liquid_payout.php | 72 ----------------------- public/include/config/global.inc.dist.php | 9 --- 2 files changed, 81 deletions(-) delete mode 100755 cronjobs/liquid_payout.php diff --git a/cronjobs/liquid_payout.php b/cronjobs/liquid_payout.php deleted file mode 100755 index a0c9be13..00000000 --- a/cronjobs/liquid_payout.php +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/php -logFatal('Missing config option: coldwallet'); - $monitoring->endCronjob($cron_name, 'E0075', 1, true); -} - -// Check RPC connection -if ($bitcoin->can_connect() !== true) { - $log->logFatal('Unable to connect to RPC server, exiting'); - $monitoring->endCronjob($cron_name, 'E0006', 1, true); -} else { - // Check Wallet Balance - $dBalance = $bitcoin->getbalance(); - $log->logDebug('The wallet balance is: ' .$dBalance); - - // Do we have anything available at all? - if (! ($dBalance > 0)) { - $log->logInfo('No coins available in wallet'); - $monitoring->endCronjob($cron_name, 'E0076', 0, true, false); - } - - // Check for POS Mint - $dGetInfo = $bitcoin->getinfo(); - if (is_array($dGetInfo) && array_key_exists('newmint', $dGetInfo)) { - $dNewmint = $dGetInfo['newmint']; - $log->logDebug('Current Mint is: ' . $dNewmint); - } else { - $dNewmint = -1; - } -} - -// Fetch locked balance from transactions -$dLockedBalance = $transaction->getLockedBalance(); -$log->logDebug('The locked wallet balance for users is: ' . $dLockedBalance); - -// Fetch Final Wallet Balance after Transfer -$dFloat = $dLockedBalance + $config['coldwallet']['reserve']; -$dThreshold = $config['coldwallet']['threshold']; -$log->logDebug('The locked wallet balance + reserves amounts to: ' . $dFloat); - -// Send Liquid Balance -$sendAddress = $config['coldwallet']['address']; -$send = $dBalance - $dFloat ; -$log->logDebug('Final Sending Amount is : ' . $send); - -if($send > $dThreshold) { - if (!empty($sendAddress)) { - try { - $bitcoin->sendtoaddress($sendAddress, $send); - } catch (Exception $e) { - $log->logFatal('Failed to send coins to address, skipping liquid assets payout:' . $e->getMessage()); - $monitoring->endCronjob($cron_name, 'E0077', 1, true); - } - $log->logInfo('Sent out ' . $send . ' liquid assets'); - } else { - $log->logDebug('No wallet address set'); - } -} else { - $log->logDebug('Final sending amount not exceeding threshold: ' . $send); -} - -// Cron cleanup and monitoring -require_once('cron_end.inc.php'); -?> diff --git a/public/include/config/global.inc.dist.php b/public/include/config/global.inc.dist.php index fb7e22e2..900ca7de 100644 --- a/public/include/config/global.inc.dist.php +++ b/public/include/config/global.inc.dist.php @@ -50,15 +50,6 @@ $config['wallet']['host'] = 'localhost:19334'; $config['wallet']['username'] = 'testnet'; $config['wallet']['password'] = 'testnet'; -/** - * Cold Wallet / Liquid Assets - * Automatically send liquid assets to a cold wallet - * https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-liquid-assets--cold-wallet - **/ -$config['coldwallet']['address'] = ''; -$config['coldwallet']['reserve'] = 50; -$config['coldwallet']['threshold'] = 5; - /** * Getting Started Config * Shown to users in the 'Getting Started' section