Skip to content

Commit

Permalink
Merge pull request #2367 from Taraxa-project/tip_block_missing
Browse files Browse the repository at this point in the history
fix: missing tip block on tips selection
  • Loading branch information
mfrankovi authored Mar 7, 2023
2 parents c28e4b7 + 6a5d35e commit 5e66cc1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libraries/core_libs/consensus/src/dag/dag_block_proposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,14 @@ vec_blk_t DagBlockProposer::selectDagBlockTips(const vec_blk_t& frontier_tips, u
// Retrieve all the tips blocks and identify duplicate proposer tips
for (const auto& t : frontier_tips) {
auto tip_block = dag_mgr_->getDagBlock(t);
assert(tip_block != nullptr);
tips_blocks.insert({t, tip_block});
if (!proposers.insert(tip_block->getSender()).second) {
duplicate_proposers.insert(tip_block->getSender());
if (tip_block == nullptr) {
// This could happen if a tip block has expired, exclude this tip
LOG(log_nf_) << "selectDagBlockTips, Cannot find tip dag block " << tip_block;
} else {
tips_blocks.insert({t, tip_block});
if (!proposers.insert(tip_block->getSender()).second) {
duplicate_proposers.insert(tip_block->getSender());
}
}
}

Expand Down

0 comments on commit 5e66cc1

Please sign in to comment.