From f6bba02f9c00745935d721ca52e8efa26579bfbb Mon Sep 17 00:00:00 2001 From: RealEther Date: Thu, 11 Jul 2024 21:52:28 +0530 Subject: [PATCH] Update Currency.cpp --- src/CryptoNoteCore/Currency.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CryptoNoteCore/Currency.cpp b/src/CryptoNoteCore/Currency.cpp index 89ef12b9c4..7ddbfa677c 100755 --- a/src/CryptoNoteCore/Currency.cpp +++ b/src/CryptoNoteCore/Currency.cpp @@ -78,7 +78,6 @@ bool Currency::generateGenesisBlock() { return false; } - BinaryArray minerTxBlob = toBinaryArray(genesisTransaction); m_genesisBlock.baseTransaction = genesisTransaction; m_genesisBlock.majorVersion = BLOCK_MAJOR_VERSION_1; @@ -149,6 +148,13 @@ bool Currency::getBlockReward(size_t medianSize, size_t currentBlockSize, uint64 assert(alreadyGeneratedCoins <= m_moneySupply); assert(m_emissionSpeedFactor > 0 && m_emissionSpeedFactor <= 8 * sizeof(uint64_t)); + // Check if it's the genesis block + if (alreadyGeneratedCoins == 0) { + reward = parameters::GENESIS_BLOCK_REWARD; + emissionChange = reward; + return true; + } + uint64_t baseReward = (m_moneySupply - alreadyGeneratedCoins) >> m_emissionSpeedFactor; medianSize = std::max(medianSize, m_blockGrantedFullRewardZone);