77
88#include < cachemap.h>
99#include < cachemultimap.h>
10+ #include < governance/signing.h>
11+
1012#include < protocol.h>
1113#include < sync.h>
1214
15+ #include < chrono>
1316#include < limits>
1417#include < map>
1518#include < memory>
19+ #include < optional>
1620#include < set>
1721#include < string>
1822#include < string_view>
@@ -236,7 +240,7 @@ class GovernanceStore
236240//
237241// Governance Manager : Contains all proposals for the budget
238242//
239- class CGovernanceManager : public GovernanceStore
243+ class CGovernanceManager : public GovernanceStore , public GovernanceSignerParent
240244{
241245 friend class CGovernanceObject ;
242246
@@ -275,7 +279,7 @@ class CGovernanceManager : public GovernanceStore
275279
276280 bool LoadCache (bool load_cache);
277281
278- bool IsValid () const { return is_valid; }
282+ bool IsValid () const override { return is_valid; }
279283
280284 /* *
281285 * This is called by AlreadyHave in net_processing.cpp as part of the inventory
@@ -292,15 +296,15 @@ class CGovernanceManager : public GovernanceStore
292296 void DoMaintenance (CConnman& connman);
293297
294298 const CGovernanceObject* FindConstGovernanceObject (const uint256& nHash) const EXCLUSIVE_LOCKS_REQUIRED(cs);
295- CGovernanceObject* FindGovernanceObject (const uint256& nHash) EXCLUSIVE_LOCKS_REQUIRED(!cs);
296- CGovernanceObject* FindGovernanceObjectByDataHash (const uint256& nDataHash) EXCLUSIVE_LOCKS_REQUIRED(!cs);
299+ CGovernanceObject* FindGovernanceObject (const uint256& nHash) override EXCLUSIVE_LOCKS_REQUIRED(!cs);
300+ CGovernanceObject* FindGovernanceObjectByDataHash (const uint256& nDataHash) override EXCLUSIVE_LOCKS_REQUIRED(!cs);
297301 void DeleteGovernanceObject (const uint256& nHash);
298302
299303 // These commands are only used in RPC
300304 std::vector<CGovernanceVote> GetCurrentVotes (const uint256& nParentHash, const COutPoint& mnCollateralOutpointFilter) const ;
301305 void GetAllNewerThan (std::vector<CGovernanceObject>& objs, int64_t nMoreThanTime) const ;
302306
303- void AddGovernanceObject (CGovernanceObject& govobj, PeerManager& peerman, const CNode* pfrom = nullptr );
307+ void AddGovernanceObject (CGovernanceObject& govobj, PeerManager& peerman, const CNode* pfrom = nullptr ) override ;
304308
305309 void CheckAndRemove ();
306310
@@ -310,7 +314,7 @@ class CGovernanceManager : public GovernanceStore
310314 int64_t GetLastDiffTime () const { return nTimeLastDiff; }
311315 void UpdateLastDiffTime (int64_t nTimeIn) { nTimeLastDiff = nTimeIn; }
312316
313- int GetCachedBlockHeight () const { return nCachedBlockHeight; }
317+ int GetCachedBlockHeight () const override { return nCachedBlockHeight; }
314318
315319 // Accessors for thread-safe access to maps
316320 bool HaveObjectForHash (const uint256& nHash) const ;
@@ -327,11 +331,11 @@ class CGovernanceManager : public GovernanceStore
327331
328332 void MasternodeRateUpdate (const CGovernanceObject& govobj);
329333
330- bool MasternodeRateCheck (const CGovernanceObject& govobj, bool fUpdateFailStatus = false );
334+ bool MasternodeRateCheck (const CGovernanceObject& govobj, bool fUpdateFailStatus = false ) override ;
331335
332336 bool MasternodeRateCheck (const CGovernanceObject& govobj, bool fUpdateFailStatus , bool fForce , bool & fRateCheckBypassed );
333337
334- bool ProcessVoteAndRelay (const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman, PeerManager& peerman);
338+ bool ProcessVoteAndRelay (const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman, PeerManager& peerman) override ;
335339
336340 void CheckPostponedObjects (PeerManager& peerman);
337341
@@ -352,7 +356,7 @@ class CGovernanceManager : public GovernanceStore
352356 * - Track governance objects which are triggers
353357 * - After triggers are activated and executed, they can be removed
354358 */
355- std::vector<std::shared_ptr<CSuperblock>> GetActiveTriggers () const EXCLUSIVE_LOCKS_REQUIRED(!cs);
359+ std::vector<std::shared_ptr<CSuperblock>> GetActiveTriggers () const override EXCLUSIVE_LOCKS_REQUIRED(!cs);
356360 bool AddNewTrigger (uint256 nHash) EXCLUSIVE_LOCKS_REQUIRED(cs);
357361 void CleanAndRemoveTriggers () EXCLUSIVE_LOCKS_REQUIRED(cs);
358362
@@ -376,10 +380,10 @@ class CGovernanceManager : public GovernanceStore
376380 bool IsValidSuperblock (const CChain& active_chain, const CDeterministicMNList& tip_mn_list,
377381 const CTransaction& txNew, int nBlockHeight, CAmount blockReward);
378382
379- bool GetBestSuperblock (const CDeterministicMNList& tip_mn_list, CSuperblock_sptr& pSuperblockRet, int nBlockHeight)
383+ bool GetBestSuperblock (const CDeterministicMNList& tip_mn_list, CSuperblock_sptr& pSuperblockRet, int nBlockHeight) override
380384 EXCLUSIVE_LOCKS_REQUIRED(!cs);
381385
382- std::vector<std::shared_ptr<const CGovernanceObject>> GetApprovedProposals (const CDeterministicMNList& tip_mn_list)
386+ std::vector<std::shared_ptr<const CGovernanceObject>> GetApprovedProposals (const CDeterministicMNList& tip_mn_list) override
383387 EXCLUSIVE_LOCKS_REQUIRED(!cs);
384388
385389private:
0 commit comments