goback(); JavascriptFile("/extensions/jqplot/jquery.jqplot.js"); JavascriptFile("/extensions/jqplot/plugins/jqplot.dateAxisRenderer.js"); JavascriptFile("/extensions/jqplot/plugins/jqplot.highlighter.js"); $this->pageTitle = $coin->name." block explorer"; $start = (int) getiparam('start'); echo << $(function() { $('#favicon').remove(); $('head').append(''); }); END; // version is used for multi algo coins // but each coin use different values... $multiAlgos = $coin->multialgos || versionToAlgo($coin, 0) !== false; echo '
'; echo '
'; echo '
'.$coin->name.' Explorer
'; echo '
'; echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($multiAlgos) echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $remote = new WalletRPC($coin); if (!$start || $start > $coin->block_height) $start = $coin->block_height; for($i = $start; $i > max(1, $start-21); $i--) { $hash = $remote->getblockhash($i); if(!$hash) continue; $block = $remote->getblock($hash); if(!$block) continue; $d = datetoa2($block['time']); $confirms = isset($block['confirmations'])? $block['confirmations']: ''; $tx = count($block['tx']); $diff = $block['difficulty']; $algo = versionToAlgo($coin, $block['version']); $type = ''; if (arraySafeval($block,'nonce',0) > 0) $type = 'PoW'; else if (isset($block['auxpow'])) $type = 'Aux'; else if (isset($block['mint']) || strstr(arraySafeVal($block,'flags',''), 'proof-of-stake')) $type = 'PoS'; // nonce 256bits if ($type == '' && $coin->symbol=='ZEC') $type = 'PoW'; // debuglog($block); echo ''; echo ''; echo ''; echo ''; echo ''; if ($multiAlgos) echo ""; echo ''; echo ''; echo ''; echo ""; } echo "
AgeHeightDifficultyTypeAlgoTxConfBlockhash
'.$d.''.$coin->createExplorerLink($i, array('height'=>$i)).''.$diff.''.$type.'$algo'.$tx.''.$confirms.''; echo $coin->createExplorerLink($hash, array('hash'=>$hash)); echo '
"; $pager = ''; if ($start <= $coin->block_height - 20) $pager = $coin->createExplorerLink('<< Prev', array('start'=>min($coin->block_height,$start+20))); if ($start != $coin->block_height) $pager .= '  '.$coin->createExplorerLink('Now'); if ($start > 20) $pager .= '  '.$coin->createExplorerLink('Next >>', array('start'=>max(1,$start-20))); $actionUrl = $coin->visible ? '/explorer/'.$coin->symbol : '/explorer/search?id='.$coin->id; echo <<$pager
end; if ($start != $coin->block_height) return; echo <<













end; app()->clientScript->registerScript('graph'," graph_refresh(); ", CClientScript::POS_READY);