Skip to content

Commit

Permalink
fixed consensus bug related to miners motivations to include transact…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
cryptozoidberg committed Mar 21, 2024
1 parent e11ee0f commit 09d08ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/currency_core/blockchain_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,14 @@ bool blockchain_storage::is_reorganize_required(const block_extended_info& main_
main_chain_bei.this_block_tx_fee_median * main_chain_bei.bl.tx_hashes.size())
{
//with the rest equal, alt block has more fees in it, prefer it
LOG_PRINT_L1("[is_reorganize_required]:TRUE, \"by order of tx_hashes.size()\" main_stake_hash:" << &main_chain_bei.stake_hash << ", alt_stake_hash" << proof_alt);
return true;
}else if (alt_chain_bei.this_block_tx_fee_median * alt_chain_bei.bl.tx_hashes.size() <
main_chain_bei.this_block_tx_fee_median * main_chain_bei.bl.tx_hashes.size())
{
//with the rest equal, alt block has more fees in it, prefer it
LOG_PRINT_L1("[is_reorganize_required]:FALSE, \"by order of tx_hashes.size()\" main_stake_hash:" << &main_chain_bei.stake_hash << ", alt_stake_hash" << proof_alt);
return false;
}
}
if (!is_pos_block(main_chain_bei.bl))
Expand Down

0 comments on commit 09d08ba

Please sign in to comment.