Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Feb 10, 2024
1 parent 13e6bd9 commit 062bc3c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nano/lib/stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ void nano::stats::update_counter (nano::stats::counter_key key, std::function<vo
{
updater (*it->second);

if (key != all_key) // Also update the `all` counter
if (key != all_key)
{
auto it_all = counters.find (all_key);
release_assert (it_all != counters.end ()); // The `all` counter should always be created together
updater (*it_all->second);
updater (*it_all->second); // Also update the `all` counter
}
}
}
Expand All @@ -235,7 +235,11 @@ void nano::stats::update_counter (nano::stats::counter_key key, std::function<vo
auto [it_all, inserted_all] = counters.emplace (all_key, std::make_unique<counter_entry> ());

updater (*it->second);
updater (*it_all->second);

if (key != all_key)
{
updater (*it_all->second); // Also update the `all` counter
}
}
}

Expand Down

0 comments on commit 062bc3c

Please sign in to comment.