From 0e792e34f3bcf4d89e7f225490dd2338944a7371 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 13 Feb 2014 09:21:19 +0100 Subject: [PATCH 1/2] [UPDATE] message only if more than 1 account in wallet and Default has no funds --- public/include/admin_checks.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/public/include/admin_checks.php b/public/include/admin_checks.php index e78ec1c6..f3fed1c3 100644 --- a/public/include/admin_checks.php +++ b/public/include/admin_checks.php @@ -80,11 +80,10 @@ if (@$_SESSION['USERDATA']['is_admin'] && $user->isAdmin(@$_SESSION['USERDATA'][ // check if there is more than one account set on wallet $accounts = $bitcoin->listaccounts(); if (count($accounts) > 1) { - $error[] = "There are " . count($accounts) . " Accounts set in local Wallet. Please ensure that there is enough Balance on the Default Account to avoid issues with payouts done with sendtoaddress or sendmany!!!"; - } - foreach ($accounts as $account => $balance) { - if ($account == "" && $balance <= 0) { - $error[] = "Default Account has no liquid funds to pay your miners!"; + foreach ($accounts as $account => $balance) { + if ($account == "" && $balance <= 0) { + $error[] = "There are " . count($accounts) . " Accounts set in local Wallet and Default Account has no liquid funds to pay your miners!"; + } } } } From 58085eb7f58c9445faabc520852a2de311bca908 Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Thu, 13 Feb 2014 09:30:07 +0100 Subject: [PATCH 2/2] [UPDATE] cleanup --- public/include/admin_checks.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/public/include/admin_checks.php b/public/include/admin_checks.php index f3fed1c3..b10e9dfa 100644 --- a/public/include/admin_checks.php +++ b/public/include/admin_checks.php @@ -79,12 +79,8 @@ if (@$_SESSION['USERDATA']['is_admin'] && $user->isAdmin(@$_SESSION['USERDATA'][ // check if there is more than one account set on wallet $accounts = $bitcoin->listaccounts(); - if (count($accounts) > 1) { - foreach ($accounts as $account => $balance) { - if ($account == "" && $balance <= 0) { - $error[] = "There are " . count($accounts) . " Accounts set in local Wallet and Default Account has no liquid funds to pay your miners!"; - } - } + if (count($accounts) > 1 && $accounts[''] <= 0) { + $error[] = "There are " . count($accounts) . " Accounts set in local Wallet and Default Account has no liquid funds to pay your miners!"; } } } catch (Exception $e) {