Fix election calling confirm_if_quorum after destruction (#2563)
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.
This commit is contained in:
parent
58080cc8cf
commit
ec886e7bb0
1 changed files with 0 additions and 1 deletions
|
|
@ -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));
|
blocks.emplace (std::make_pair (block_a->hash (), block_a));
|
||||||
insert_inactive_votes_cache (block_a->hash ());
|
insert_inactive_votes_cache (block_a->hash ());
|
||||||
confirm_if_quorum ();
|
|
||||||
node.network.flood_block (block_a, false);
|
node.network.flood_block (block_a, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue