pageTitle = $coin->name." bloc explorer"; if ($coin) echo << $(function() { $('#favicon').remove(); $('head').append(''); }); ENDJS; function simplifyscript($script) { $script = preg_replace("/[0-9a-f]+ OP_DROP ?/","", $script); $script = preg_replace("/OP_NOP ?/","", $script); return trim($script); } /////////////////////////////////////////////////////////////////////////////////////////////// $remote = new Bitcoin($coin->rpcuser, $coin->rpcpasswd, $coin->rpchost, $coin->rpcport); $block = $remote->getblock($hash); if(!$block) return; //debuglog($block); $d = date('Y-m-d H:i:s', $block['time']); $confirms = isset($block['confirmations'])? $block['confirmations']: ''; $txcount = count($block['tx']); $version = dechex($block['version']); $nonce = dechex($block['nonce']); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if(isset($block['flags'])) echo ""; if(isset($block['previousblockhash'])) echo ""; if(isset($block['nextblockhash'])) echo ""; echo ""; echo "
Coin:$coin->name
Blockhash:$hash
Confirmations:$confirms
Size:{$block['size']} bytes
Height:{$block['height']}
Time:$d
Difficulty:{$block['difficulty']}
Version:$version
Merkle Root:{$block['merkleroot']}
Nonce:$nonce
Bits:{$block['bits']}
Flags:{$block['flags']}
Previous Hash: {$block['previousblockhash']}
Next Hash: {$block['nextblockhash']}
Transactions:$txcount

"; //////////////////////////////////////////////////////////////////////////////// echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; foreach($block['tx'] as $txhash) { $tx = $remote->getrawtransaction($txhash, 1); if(!$tx) continue; $valuetx = 0; foreach($tx['vout'] as $vout) $valuetx += $vout['value']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo '
Transaction HashValueFrom (amount)To (amount)
{$tx['txid']}$valuetx"; foreach($tx['vin'] as $vin) { if(isset($vin['coinbase'])) echo "Generation"; } echo ""; foreach($tx['vout'] as $vout) { $value = $vout['value']; if(isset($vout['scriptPubKey']['addresses'][0])) echo "{$vout['scriptPubKey']['addresses'][0]} ($value)"; else echo "($value)"; echo '
'; } echo "
';

if (user()->getState('yaamp_admin'))
	echo json_encode($block, 128);

echo <<
end; echo '









'; echo '









'; echo '









';