Skip to content

Commit

Permalink
improve the system trxs condition
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusKysel committed Jun 13, 2024
1 parent b923510 commit ef779e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions libraries/core_libs/consensus/src/final_chain/final_chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ class FinalChainImpl final : public FinalChain {

std::vector<SharedTransaction> makeSystemTransactions(PbftPeriod blk_num) {
std::vector<SharedTransaction> system_transactions;
auto bridge_contract = get_account(kHardforksConfig.ficus_hf.bridge_contract_address);
bool is_pillar_block_period = kHardforksConfig.ficus_hf.isPillarBlockPeriod(blk_num);
bool is_bridge_contract_exists = bridge_contract && bridge_contract->code_size;
bool is_need_to_finalize = isNeedToFinalize(blk_num - 1);
if (is_pillar_block_period && is_bridge_contract_exists && is_need_to_finalize) {
auto finalize_trx = make_bridge_finalization_transaction();
system_transactions.push_back(finalize_trx);
if (kHardforksConfig.ficus_hf.isPillarBlockPeriod(blk_num)) {
if (const auto bridge_contract = get_account(kHardforksConfig.ficus_hf.bridge_contract_address);
bridge_contract) {
if (bridge_contract->code_size && isNeedToFinalize(blk_num - 1)) {
auto finalize_trx = make_bridge_finalization_transaction();
system_transactions.push_back(finalize_trx);
}
}
}
return system_transactions;
}
Expand Down
2 changes: 1 addition & 1 deletion submodules/taraxa-evm
Submodule taraxa-evm updated 0 files

0 comments on commit ef779e3

Please sign in to comment.