From ec886e7bb00e9547e787eb517ecafd1141bac708 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Mon, 17 Feb 2020 15:54:11 +0000 Subject: [PATCH] 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. --- nano/node/election.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/nano/node/election.cpp b/nano/node/election.cpp index 7964f19d03..d4cc681dc1 100644 --- a/nano/node/election.cpp +++ b/nano/node/election.cpp @@ -220,7 +220,6 @@ bool nano::election::publish (std::shared_ptr 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