From 139dca7ac0a2e9c4b13e83c0913bf4acc9424350 Mon Sep 17 00:00:00 2001 From: PabloWong <47540797+PabloWong@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:02:44 -0400 Subject: [PATCH] blockRewardFunction bug there was a bug running in regtest --- app/coins/btc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/coins/btc.js b/app/coins/btc.js index 3273b6671..e52e0f00d 100644 --- a/app/coins/btc.js +++ b/app/coins/btc.js @@ -565,7 +565,9 @@ module.exports = { blockRewardFunction:function(blockHeight, chain) { let halvingBlockInterval = (chain == "regtest" ? 150 : 210000); let index = Math.floor(blockHeight / halvingBlockInterval); - - return blockRewardEras[index]; + if (blockRewardEras[index]) + return blockRewardEras[index]; + else + return 0; } };