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);