From 692a0403cbfeb675a798316c6ac7193c54ade81d Mon Sep 17 00:00:00 2001 From: danielw86dev <67072678+danielw86dev@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:34:56 +0200 Subject: [PATCH] Fix displaying number of forks - fixed the number of forks shown (need DISPLAY_FORKS+1 iteration, because first loop run is active fork) - fixed recentForks count (use correct block time and don't count active fork) --- src/Content.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content.php b/src/Content.php index 20d45ac..314cf5b 100644 --- a/src/Content.php +++ b/src/Content.php @@ -147,7 +147,7 @@ function createForksContent(){ $lastTime = 0; foreach($forks as $fork){ - if($i == Config::DISPLAY_FORKS){ + if($i > Config::DISPLAY_FORKS){ break; } @@ -168,7 +168,7 @@ function createForksContent(){ $content["blocks"][$i]["timeago"] = round((time() - $block["time"])/ (($i === 0) ? 60 : 86400)); $content["blocks"][$i]["txcount"] = count($block["tx"]); - if($content["blocks"][$i]["time"] >= $timeAgo){ + if($block["time"] >= $timeAgo && $fork["status"] != "active"){ $content["recentForks"]++; } }