From a7401d30a0345450fb456720b77dca8c14f3d42a Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 19 Jul 2015 12:37:06 +0200 Subject: [PATCH] [ADDED] Check download status in admin setup check --- include/pages/admin/checks/check_daemon.inc.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/pages/admin/checks/check_daemon.inc.php b/include/pages/admin/checks/check_daemon.inc.php index 06645ade..a4d44507 100644 --- a/include/pages/admin/checks/check_daemon.inc.php +++ b/include/pages/admin/checks/check_daemon.inc.php @@ -13,8 +13,7 @@ try { $newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc"; $error[] = $newerror; $newerror = null; - } - else { + } else { // validate that the wallet service is not in test mode if ($bitcoin->is_testnet() == true) { $newerror = array(); @@ -27,6 +26,18 @@ try { $error[] = $newerror; $newerror = null; } + // Check if chain is currently downloading + if ($dDownloadPercentage = $bitcoin->getblockchaindownload()) { + $newerror = array(); + $newerror['name'] = "Coin daemon"; + $newerror['level'] = 1; + $newerror['extdesc'] = "Your coin daemon is currently downloading the blockchain. Your miners won't be able to connect until this is completed."; + $newerror['description'] = "Blockchain download progress is at an estimated $dDownloadPercentage%. It may take a while to complete."; + $newerror['configvalue'] = "wallet.host"; + $newerror['helplink'] = "https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-local-wallet-rpc"; + $error[] = $newerror; + $newerror = null; + } // check if there is more than one account set on wallet $accounts = $bitcoin->listaccounts(); if (count($accounts) > 1 && $accounts[''] <= 0) {