From dfe8528debb7d7319afd751d05a5cc9bd3fd6595 Mon Sep 17 00:00:00 2001 From: MEUNIER Thibaud Date: Sat, 29 Dec 2018 10:01:06 +0100 Subject: [PATCH] blockchain : cache.php se limite aux 6 derniers blocs --- blockchain/cache.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/blockchain/cache.php b/blockchain/cache.php index 247a8fd..91a3835 100644 --- a/blockchain/cache.php +++ b/blockchain/cache.php @@ -30,19 +30,17 @@ if ($the_block === FALSE) die(); // --- On en recherche 6 sur approximativement 6 heures (36 blocks) // --- $max = 6; -$max2 = 36; -while(($max > 0)&&($max2 > 0)) +while($max > 0) { $block_hash = $the_block->prev_block; if (!file_exists(DATA_PATH.'/json/'.$block_hash.'.zip')) - echo 'CACHE '.$block_hash.' '.($the_block->height-1)." ".$the_block->n_tx.PHP_EOL; + 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--; } ?>