diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp index e44088071d749c..0fe1b79606f062 100644 --- a/src/test/versionbits_tests.cpp +++ b/src/test/versionbits_tests.cpp @@ -16,18 +16,6 @@ /* Define a virtual block time, one block per 10 minutes after Nov 14 2014, 0:55:36am */ static int32_t TestTime(int nHeight) { return 1415926536 + 600 * nHeight; } -static std::string StateName(ThresholdState state) -{ - switch (state) { - case ThresholdState::DEFINED: return "DEFINED"; - case ThresholdState::STARTED: return "STARTED"; - case ThresholdState::LOCKED_IN: return "LOCKED_IN"; - case ThresholdState::ACTIVE: return "ACTIVE"; - case ThresholdState::FAILED: return "FAILED"; - } // no default case, so the compiler can warn about missing cases - return ""; -} - class TestConditionChecker : public AbstractThresholdConditionChecker { private: diff --git a/src/versionbits.cpp b/src/versionbits.cpp index 3f6d0573e168ea..660e24e41c73f2 100644 --- a/src/versionbits.cpp +++ b/src/versionbits.cpp @@ -302,7 +302,7 @@ std::vector> VersionBitsCache::CheckUnknownActivations(cons return result; } -static std::string StateName(ThresholdState state) +std::string StateName(ThresholdState state) { switch (state) { case ThresholdState::DEFINED: return "defined"; diff --git a/src/versionbits_impl.h b/src/versionbits_impl.h index df56a51818a382..16c03ff11437c8 100644 --- a/src/versionbits_impl.h +++ b/src/versionbits_impl.h @@ -25,6 +25,9 @@ enum class ThresholdState : uint8_t { FAILED, // For all blocks once the first retarget period after the timeout time is hit, if LOCKED_IN wasn't already reached (final state) }; +/** Get a string with the state name */ +std::string StateName(ThresholdState state); + /** * Abstract class that implements BIP9-style threshold logic, and caches results. */