瀏覽代碼

blockchain : cache.php se limite aux 6 derniers blocs

master
MEUNIER Thibaud 7 年之前
父節點
當前提交
dfe8528deb
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. +2
    -4
      blockchain/cache.php

+ 2
- 4
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--;
}
?>

Loading…
取消
儲存