hashes tient compte du cache

This commit is contained in:
2018-12-29 09:56:36 +01:00
parent b1ed2170f6
commit 3c7acc8443
12 changed files with 53 additions and 42 deletions

View File

@@ -27,23 +27,21 @@ $the_block = blockchain::getSpecialBlock($block_hash);
if ($the_block === FALSE) die();
// ---
// --- On en recherche 3 sur approximativement 6 heures (36 blocks)
// --- On en recherche 6 sur approximativement 6 heures (36 blocks)
// ---
$max = 3;
$max = 6;
$max2 = 36;
while(($max > 0)&&($max2 > 0))
{
$block_hash = $the_block->prev_block;
if (!file_exists(DATA_PATH.'/json/'.$block_hash.'.zip'))
{
$max--;
echo 'CACHE '.$block_hash.' '.($the_block->height-1)." ".$the_block->n_tx.PHP_EOL;
}
$the_block = blockchain::getBlockWithHash($block_hash);
if ($the_block === FALSE) die();
$max--;
$max2--;
}