diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index 00a130e7d1..b9310a4480 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -33,6 +33,25 @@ const std::string GovernanceStore::SERIALIZATION_VERSION_STRING = "CGovernanceMa const int CGovernanceManager::MAX_TIME_FUTURE_DEVIATION = 60 * 60; const int CGovernanceManager::RELIABLE_PROPAGATION_TIME = 60; +namespace { +class ScopedLockBool +{ + bool& ref; + bool fPrevValue; + +public: + ScopedLockBool(RecursiveMutex& _cs, bool& _ref, bool _value) : + ref(_ref) + { + AssertLockHeld(_cs); + fPrevValue = ref; + ref = _value; + } + + ~ScopedLockBool() { ref = fPrevValue; } +}; +} // anonymous namespace + GovernanceStore::GovernanceStore() : cs(), mapObjects(), diff --git a/src/governance/governance.h b/src/governance/governance.h index 100e303d13..f9fe3c2e1f 100644 --- a/src/governance/governance.h +++ b/src/governance/governance.h @@ -231,26 +231,6 @@ private: using hash_s_t = std::set; using db_type = CFlatDB; - class ScopedLockBool - { - bool& ref; - bool fPrevValue; - - public: - ScopedLockBool(RecursiveMutex& _cs, bool& _ref, bool _value) : - ref(_ref) - { - AssertLockHeld(_cs); - fPrevValue = ref; - ref = _value; - } - - ~ScopedLockBool() - { - ref = fPrevValue; - } - }; - private: static const int MAX_TIME_FUTURE_DEVIATION; static const int RELIABLE_PROPAGATION_TIME;