From 09c258287119e40a7cce83cc937a12d714c2c54d Mon Sep 17 00:00:00 2001 From: Arionum Date: Thu, 11 Jan 2018 15:51:02 +0200 Subject: [PATCH] sanity --- sanity.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sanity.php b/sanity.php index 9b24da1..b4c9199 100755 --- a/sanity.php +++ b/sanity.php @@ -248,14 +248,15 @@ if($current['height']<$largest_height&&$largest_height>1){ $data=peer_post($url."getBlock",array("height"=>$current['height'])); if($data===false){ _log("Could not get block from $host - $current[height]"); continue; } - - while($data['id']!=$current['id']){ - $block->delete($current['height']-10); + if($data['id']==$most_common){ + if($data['id']!=$current['id']){ + $block->delete($current['height']-3); $current=$block->current(); $data=peer_post($url."getBlock",array("height"=>$current['height'])); if($data===false){_log("Could not get block from $host - $current[height]"); break; } } + } if($data['id']!=$current['id']) continue; while($current['height']<$largest_height){ $data=peer_post($url."getBlocks",array("height"=>$current['height']+1));