Skip to content

Commit

Permalink
Fix displaying number of forks
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
danielw86dev committed May 12, 2024
1 parent 6fd2ef9 commit 692a040
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function createForksContent(){
$lastTime = 0;

foreach($forks as $fork){
if($i == Config::DISPLAY_FORKS){
if($i > Config::DISPLAY_FORKS){
break;
}

Expand All @@ -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"]++;
}
}
Expand Down

0 comments on commit 692a040

Please sign in to comment.