Skip to content

Commit

Permalink
fix: missing tip block on tips selection
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrankovi committed Mar 7, 2023
1 parent c28e4b7 commit 6a5d35e
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 6a5d35e

Please sign in to comment.