coin existence calculation changes

This commit is contained in:
KarthiKeyanZ 2023-06-26 13:06:36 +05:30
parent 8f21c9d5d8
commit 74b2d99bc6

View File

@ -92,7 +92,7 @@ const getTotalRewardByHeight= async(height) => {
currentReward = 4;
} else if (height <= BLOCK_ERA_4) {
remaining_height = height - BLOCK_ERA_3;
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + 2 * remaining_height;
coin_existence = (16 * BLOCK_ERA_1) + (8 * (BLOCK_ERA_2 - BLOCK_ERA_1)) + (4 * (BLOCK_ERA_3 - BLOCK_ERA_2)) + 2 * remaining_height;
currentReward = 2;
} else if (height <= BLOCK_ERA_5) {
remaining_height = height - BLOCK_ERA_4;
@ -300,7 +300,7 @@ const latestBlockDetails = async()=> {
currentReward = 4;
} else if (height <= BLOCK_ERA_4) {
remaining_height = height - BLOCK_ERA_3;
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + 2 * remaining_height;
coin_existence = (16 * BLOCK_ERA_1) + (8 * (BLOCK_ERA_2 - BLOCK_ERA_1)) + (4 * (BLOCK_ERA_3 - BLOCK_ERA_2)) + 2 * remaining_height;
currentReward = 2;
} else if (height <= BLOCK_ERA_5) {
remaining_height = height - BLOCK_ERA_4;
@ -516,7 +516,7 @@ const previousBlockDetails = async() => {
currentReward = 4;
} else if (height <= BLOCK_ERA_4) {
remaining_height = height - BLOCK_ERA_3;
coin_existence = (16 * BLOCK_ERA_1) + (8 * BLOCK_ERA_2) + (4 * BLOCK_ERA_3) + 2 * remaining_height;
coin_existence = (16 * BLOCK_ERA_1) + (8 * (BLOCK_ERA_2 - BLOCK_ERA_1)) + (4 * (BLOCK_ERA_3 - BLOCK_ERA_2)) + 2 * remaining_height;
currentReward = 2;
} else if (height <= BLOCK_ERA_5) {
remaining_height = height - BLOCK_ERA_4;