From 21cf16259a012215cd69e974d7712dc8c234085e Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Tue, 27 Dec 2022 16:22:25 -0800 Subject: [PATCH] Update current supply calculation. --- server/utils/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/utils/common.ts b/server/utils/common.ts index 26d1783..c041ac1 100644 --- a/server/utils/common.ts +++ b/server/utils/common.ts @@ -88,7 +88,7 @@ const getTotalRewardByHeight= async(height) => { currentReward = 8; } else if (height <= BLOCK_ERA_3) { remaining_height = height - BLOCK_ERA_2; - coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + 4 * remaining_height; + coin_existence = (16 * BLOCK_ERA_1) + (8 * (BLOCK_ERA_2 - BLOCK_ERA_1 )) + 4 * remaining_height; currentReward = 4; } else if (height <= BLOCK_ERA_4) { remaining_height = height - BLOCK_ERA_3; @@ -362,7 +362,7 @@ let currentReward = 16; currentReward = 8; } else if (height <= BLOCK_ERA_3) { remaining_height = height - BLOCK_ERA_2; - coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + 4 * remaining_height; + coin_existence = (16 * BLOCK_ERA_1) + (8 * (BLOCK_ERA_2 - BLOCK_ERA_1 )) + 4 * remaining_height; currentReward = 4; } else if (height <= BLOCK_ERA_4) { remaining_height = height - BLOCK_ERA_3;