From 2482106994b278d4f482b16fb951a04131a1e300 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Wed, 11 Oct 2023 11:56:54 +0100 Subject: [PATCH] Move evaluation of election->confirmed () within debug_assert so it doesn't need to be evaluated when debugging is off. --- nano/node/active_transactions.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nano/node/active_transactions.cpp b/nano/node/active_transactions.cpp index b1bbf6a2de..44d958410c 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_transactions.cpp @@ -326,11 +326,7 @@ void nano::active_transactions::cleanup_election (nano::unique_lock { debug_assert (!mutex.try_lock ()); debug_assert (lock_a.owns_lock ()); - - if (election->confirmed ()) - { - debug_assert (recently_confirmed.exists (election->qualified_root)); - } + debug_assert (!election->confirmed () || recently_confirmed.exists (election->qualified_root)); node.stats.inc (completion_type (*election), nano::to_stat_detail (election->behavior ())); // Keep track of election count by election type