Skip to content

Commit

Permalink
verify cut reward
Browse files Browse the repository at this point in the history
  • Loading branch information
muncoin committed Jul 29, 2018
1 parent 1b3691c commit a19a4bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3642,7 +3642,8 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash&
MDEBUG("Block with id: " << id << " caused coin emission rollback, change: -" << print_money(fee_summary - base_reward));
already_generated_coins = already_generated_coins - (fee_summary - base_reward);
} else {
already_generated_coins = (base_reward - fee_summary) < (MONEY_SUPPLY-already_generated_coins) ? already_generated_coins + (base_reward - fee_summary) : MONEY_SUPPLY;
uint64_t supply = (m_hardfork->get_current_version() >= BLOCK_MAJOR_VERSION_5)? MONEY_SUPPLY_V5 : MONEY_SUPPLY;
already_generated_coins = (base_reward - fee_summary) < (supply-already_generated_coins) ? already_generated_coins + (base_reward - fee_summary) : supply;
}
if(m_db->height())
cumulative_difficulty += m_db->get_block_cumulative_difficulty(m_db->height() - 1);
Expand Down

0 comments on commit a19a4bb

Please sign in to comment.