Skip to content

Commit

Permalink
Block processor rolled back notifications on a backround thread
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Nov 25, 2024
1 parent 3d14f1e commit bb9ddec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nano/node/blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ void nano::block_processor::rollback_competitor (secure::write_transaction const
logger.debug (nano::log::type::blockprocessor, "Blocks rolled back: {}", rollback_list.size ());
}

// Notify observers of the rolled back blocks
rolled_back.notify (rollback_list, fork_block.qualified_root ());
// Notify observers of the rolled back blocks on a background thread while not holding the ledger write lock
workers.post ([this, rollback_list = std::move (rollback_list), root = fork_block.qualified_root ()] () {
rolled_back.notify (rollback_list, root);
});
}
}

Expand Down

0 comments on commit bb9ddec

Please sign in to comment.