From 2c3052be24c0a2bae5a27412a473c41c0dc6de9b Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 19 Jul 2015 11:48:49 +0200 Subject: [PATCH] [ADDED] Show Blockchain download status --- include/pages/admin/wallet.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/pages/admin/wallet.inc.php b/include/pages/admin/wallet.inc.php index ddbe081d..9738324e 100644 --- a/include/pages/admin/wallet.inc.php +++ b/include/pages/admin/wallet.inc.php @@ -23,6 +23,15 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $aGetInfo = $bitcoin->getinfo(); $aGetPeerInfo = $bitcoin->getpeerinfo(); + # Check if daemon is downloading the blockchain, estimated + $iStartingHeight = 0; + foreach ($aGetPeerInfo as $aPeerData) { + if ($iStartingHeight < $aPeerData['startingheight']) $iStartingHeight = $aPeerData['startingheight']; + } + if ($iStartingHeight > $aGetInfo['blocks']) { + $dDownloadPercentage = number_format(round($aGetInfo['blocks'] / $iStartingHeight * 100, 2), 2); + $aGetInfo['errors'] = "Downloading: $dDownloadPercentage%"; + } $aGetTransactions = $bitcoin->listtransactions('', (int)$setting->getValue('wallet_transaction_limit', 25)); if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) { $dNewmint = $aGetInfo['newmint']; @@ -61,6 +70,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $smarty->assign("ACCOUNTS", $dWalletAccounts); $smarty->assign("COLDCOINS", $dColdCoins); $smarty->assign("LOCKED", $dLockedBalance); + $smarty->assign("STARTINGHEIGHT", $iStartingHeight); + $smarty->assign("DOWNLOADPERCENTAGE", $dDownloadPercentage); $smarty->assign("NEWMINT", $dNewmint); $smarty->assign("COININFO", $aGetInfo); $smarty->assign("PEERINFO", $aGetPeerInfo);