<?php

require_once "bc_daemon.php";
require_once "bc_layout.php";
//	If a block hash was provided the block detail is shown
if (isset($_REQUEST["block_hash"])) {
    site_header("Block Detail Page");
    block_detail($_REQUEST["block_hash"], TRUE);
} elseif (isset($_REQUEST["block_height"])) {
    site_header("Block Detail Page");
    block_detail($_REQUEST["block_height"]);
} elseif (isset($_REQUEST["transaction"])) {
    site_header("Transaction Detail Page");
    tx_detail($_REQUEST["transaction"]);
} else {
    site_header("BDSM Block Crawler");
    echo "\t<div id=\"node_info\">\n";
    echo "\n";
    $network_info = getinfo();
    echo "\t\t<div class=\"node_detail\">\n";
    echo "\t\t\t<span class=\"node_desc\">Block Count:</span><br>\n";
    echo "\t\t\t" . $network_info["blocks"] . "\n";
    echo "\t\t</div>\n";
    echo "\n";
    echo "\t\t<div class=\"node_detail\">\n";
    echo "\t\t\t<span class=\"node_desc\">Difficulty:</span><br>\n";
    echo "\t\t\t" . $network_info["difficulty"] . "\n";
    echo "\t\t</div>\n";
    echo "\n";
    echo "\t\t<div class=\"node_detail\">\n";
    echo "\t\t\t<span class=\"node_desc\">Connections:</span><br>\n";
Ejemplo n.º 2
0
        $block_height = $input;
        if (empty($block_height)) {
            $network_info = getinfo();
            // Default to the latest block
            $block_height = intval($network_info["blocks"]);
        }
        //site_header ("Block Detail Page");
        block_detail($block_height);
    } elseif (strlen($input) == 64 && is_array(getblock($_GET["input"]))) {
        $info = getblock($_GET["input"]);
        //   site_header ("Block Detail Page");
        $block_hash = $_GET["input"];
        block_detail($block_hash, TRUE);
    } elseif (strlen($input) <= 64 && is_array(getrawtransaction($_GET["input"]))) {
        //site_header ("Peercoin Transaction Detail Page");
        tx_detail($_REQUEST["input"]);
    } else {
        //header('Location:index.php');
        $show_detail = false;
        $show_error = true;
        $input_error = "not a block nor a transaction, please try again";
    }
}
//	If there were no request parameters the menu is shown
if (!$show_detail) {
    site_header("Peercoin Block Viewer");
    $network_info = getinfo();
    $difficulty_info = getdifficulty();
    $net_speed = getnetworkhashps();
    ?>
<div id="site_menu">