Skip to content
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

Active_transactions updates blocks when updating difficulty. #2518

Merged
merged 4 commits into from
Feb 12, 2020

Conversation

clemahieu
Copy link
Contributor

No description provided.

…e election and instead relies on active_transactions updating itself on receipt of a higher difficulty block.
@zhyatt zhyatt added this to the V21.0 milestone Jan 29, 2020
@zhyatt zhyatt added the functionality quality improvements This item indicates the need for or supplies a better way to implement existing functionality label Jan 29, 2020
@guilhermelawless
Copy link
Contributor

This code seems redundant now, could be removed:

nano-node/nano/node/wallet.cpp

Lines 1458 to 1473 in 945c8ca

{
auto hash (block_a->hash ());
nano::lock_guard<std::mutex> active_guard (watcher_l->node.active.mutex);
auto existing (watcher_l->node.active.roots.find (root_a));
if (existing != watcher_l->node.active.roots.end ())
{
auto election (existing->election);
if (election->status.winner->hash () == hash)
{
election->status.winner = block;
}
auto current (election->blocks.find (hash));
assert (current != election->blocks.end ());
current->second = block;
}
}

@clemahieu clemahieu merged commit ec177a2 into develop Feb 12, 2020
@guilhermelawless guilhermelawless deleted the separate_update_difficulty branch February 12, 2020 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functionality quality improvements This item indicates the need for or supplies a better way to implement existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants