Skip to content

Commit

Permalink
Fix election calling confirm_if_quorum after destruction (#2563)
Browse files Browse the repository at this point in the history
When insert_inactive_votes_cache confirms the election it deletes itself from the active roots, causing the next confirm_if_quorum call to access freed memory.
  • Loading branch information
guilhermelawless committed Feb 17, 2020
1 parent 58080cc commit ec886e7
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion nano/node/election.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ bool nano::election::publish (std::shared_ptr<nano::block> block_a)
{
blocks.emplace (std::make_pair (block_a->hash (), block_a));
insert_inactive_votes_cache (block_a->hash ());
confirm_if_quorum ();
node.network.flood_block (block_a, false);
}
else
Expand Down

0 comments on commit ec886e7

Please sign in to comment.