priorité nonce

This commit is contained in:
2022-08-19 13:03:23 +02:00
parent 60dc78a4c0
commit 6d161b3804
5 changed files with 128 additions and 12 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
// ---
// --- La config globale
// ---
require_once '../global/inc/config.php';
// ---
// --- External dependances
// ---
require TOPISTO_PATH.'/ressources/vendor/autoload.php';
// ---
// --- Internal dependances
// ---
require_once APP_PATH.'/blockchain/inc/block.php';
// ---
// --- Par défaut on cherche le dernier block
// --- Le cas échéant, on cherche block passé en argument
// ---
$block_hash = 'LAST';
if (isset($argv[1])) $block_hash = $argv[1];
$the_block = blockchain::getBlockWithHash($block_hash);
if ($the_block === FALSE) die();
echo $the_block->nonce;
?>