From 7a499698968f4cbc49f2db8aa79308cbdc343804 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 7 Jan 2014 09:40:18 +0100 Subject: [PATCH 1/2] [ADDED] Address validation script Will allow admins to run a validateaddress check via RPC calls against the coind for all currently available users in the accounts table. * UNSET for users without a coin_address * INVALID for addresses not validated against the RPC * VALID for addresses that validated fine Just to give people a small tool at hands. Usually addresses are already validated during account edit, so this script is mostly for those pools that have not had that change yet and wish to notify their users. Addresses #1177 --- scripts/shared.inc.php | 47 ++++++++++++++++++++++++++++++ scripts/validate_addresses.php | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 scripts/shared.inc.php create mode 100755 scripts/validate_addresses.php diff --git a/scripts/shared.inc.php b/scripts/shared.inc.php new file mode 100644 index 00000000..18fa4834 --- /dev/null +++ b/scripts/shared.inc.php @@ -0,0 +1,47 @@ + diff --git a/scripts/validate_addresses.php b/scripts/validate_addresses.php new file mode 100755 index 00000000..39a34ffa --- /dev/null +++ b/scripts/validate_addresses.php @@ -0,0 +1,52 @@ +#!/usr/bin/php +getAllAssoc(); + +// Table mask +$mask = "| %-35.35s | %-35.35s | %-40.40s | %-7.7s |\n"; +echo 'Validating all coin addresses. This may take some time.' . PHP_EOL . PHP_EOL; + +printf($mask, 'Username', 'E-Mail', 'Address', 'Status'); +foreach ($users as $aData) { + if (empty($aData['coin_address'])) { + $status = 'UNSET'; + } + $ret = $bitcoin->validateaddress($aData['coin_address']); + if ($ret['isvalid']) { + $status = 'VALID'; + } else { + $status = 'INVALID'; + } + printf($mask, $aData['username'], $aData['email'], $aData['coin_address'], $status); +} From 3a0d0f016bcad50fdcc41b0c07fb01e823f70fda Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 7 Jan 2014 09:43:10 +0100 Subject: [PATCH 2/2] [ADDED] Payout fail hint: Wallet covers balance? --- cronjobs/payouts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cronjobs/payouts.php b/cronjobs/payouts.php index 0c4ac0d3..b3840fef 100755 --- a/cronjobs/payouts.php +++ b/cronjobs/payouts.php @@ -68,7 +68,7 @@ if ($setting->getValue('disable_manual_payouts') != 1) { try { $txid = $bitcoin->sendtoaddress($aData['coin_address'], $dBalance - $config['txfee']); } catch (BitcoinClientException $e) { - $log->logError('Failed to send requested balance to coin address, please check payout process'); + $log->logError('Failed to send requested balance to coin address, please check payout process. Does the wallet cover the amount?'); continue; } @@ -132,7 +132,7 @@ if ($setting->getValue('disable_auto_payouts') != 1) { try { $txid = $bitcoin->sendtoaddress($aUserData['coin_address'], $dBalance - $config['txfee']); } catch (BitcoinClientException $e) { - $log->logError('Failed to send requested balance to coin address, please check payout process'); + $log->logError('Failed to send requested balance to coin address, please check payout process. Does the wallet cover the amount?'); continue; }