Skip to content

Commit

Permalink
Remove local votes from election with winner change
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiySW committed Mar 31, 2020
1 parent 1a8b8ba commit 494b3bc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nano/node/election.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,13 @@ void nano::election::remove_votes (nano::block_hash const & hash_a)
{
if (node.config.enable_voting && node.wallets.rep_counts ().voting > 0)
{
// Remove votes from election
auto list_generated_votes (node.votes_cache.find (hash_a));
for (auto const & vote : list_generated_votes)
{
last_votes.erase (vote->account);
}
// Clear votes cache
node.votes_cache.remove (hash_a);
}
}

0 comments on commit 494b3bc

Please sign in to comment.