Skip to content

Commit

Permalink
Update Currency.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
HashHound committed Jul 11, 2024
1 parent 55d41a2 commit e8a0ef5
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/CryptoNoteCore/Currency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,14 @@ bool Currency::constructGenesisTransaction(Transaction& tx) const {
bool Currency::generateGenesisBlock() {
m_genesisBlock = boost::value_initialized<Block>();

// Hardcoded genesis coinbase transaction
std::string genesisCoinbaseTxHex = GENESIS_COINBASE_TX_HEX;
BinaryArray minerTxBlob;

bool r =
fromHex(genesisCoinbaseTxHex, minerTxBlob) &&
fromBinaryArray(m_genesisBlock.baseTransaction, minerTxBlob);

if (!r) {
logger(ERROR, BRIGHT_RED) << "Failed to parse coinbase tx from hardcoded blob";
Transaction genesisTransaction;
if (!constructGenesisTransaction(genesisTransaction)) {
logger(ERROR, BRIGHT_RED) << "Failed to construct genesis transaction";
return false;
}

m_genesisBlock.baseTransaction = genesisTransaction;

m_genesisBlock.majorVersion = BLOCK_MAJOR_VERSION_1;
m_genesisBlock.minorVersion = BLOCK_MINOR_VERSION_0;
m_genesisBlock.timestamp = 0;
Expand All @@ -154,6 +149,7 @@ bool Currency::generateGenesisBlock() {
logger(INFO) << "Genesis block generated with hash: " << Common::podToHex(m_genesisBlockHash);
return true;
}
}

bool Currency::getBlockReward(size_t medianSize, size_t currentBlockSize, uint64_t alreadyGeneratedCoins,
uint64_t fee, uint64_t& reward, int64_t& emissionChange) const {
Expand Down

0 comments on commit e8a0ef5

Please sign in to comment.