-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recalculate work for long unconfirmed local blocks #1860
Conversation
…hem above the trended active_difficulty
rebased to dd46609 and adjusted to calculate new work above active_difficulty every announcement period. |
auto callback = [node_l, block_l, election_l](boost::optional<uint64_t> const & work_a) { | ||
if (work_a && !nano::work_validate (block_l->root (), work_a.get ())) | ||
{ | ||
block_l->block_work_set (work_a.get ()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This updates a block's work
field without a lock / it's not atomic.
Because of the block uniquer, I believe the same block can be accessed or have its work validated by other threads (such as the same block arriving again over bootstrap or realtime traffic)
using a difficulty threshold of the long unconfirmed block
#1858 allows for recalculating with a threshold of active_difficulty instead
part of #1336