php-mpos/public/include/pages/statistics.inc.php
2013-06-30 19:35:49 +02:00

21 lines
689 B
PHP

<?php
// Make sure we are called from index.php
if (!defined('SECURITY'))
die('Hacking attempt');
if ($bitcoin->can_connect() === true){
$dDifficulty = $bitcoin->query('getdifficulty');
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
$dDifficulty = $dDifficulty['proof-of-work'];
$iBlock = $bitcoin->query('getblockcount');
} else {
$dDifficulty = 1;
$iBlock = 0;
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to litecoind RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'errormsg');
}
$smarty->assign("CURRENTBLOCK", $iBlock);
$smarty->assign("DIFFICULTY", $dDifficulty);
$smarty->assign("CONTENT", "default.tpl");