From bbe01d0bd2d4413c2de103af3ea98fcaa7e0cc5e Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 28 Aug 2019 16:56:22 +0200 Subject: [PATCH] stats: fix state assertions in stats hook --- lib/hooks/stats.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/hooks/stats.cpp b/lib/hooks/stats.cpp index b6bf63240..94696e402 100644 --- a/lib/hooks/stats.cpp +++ b/lib/hooks/stats.cpp @@ -232,12 +232,16 @@ public: virtual void prepare() { + assert(state == State::CHECKED); + stats = std::make_shared(buckets, warmup); /* Register statistic object to path. * * This allows the path code to update statistics. */ node->stats = stats; + + state = State::PREPARED; } };