LCOV - code coverage report
Current view: top level - src/node - sync_manager.h (source / functions) Hit Total Coverage
Test: test_dash_coverage.info Lines: 4 12 33.3 %
Date: 2026-06-25 07:23:51 Functions: 5 10 50.0 %

          Line data    Source code
       1             : // Copyright (c) 2014-2025 The Dash Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #ifndef BITCOIN_NODE_SYNC_MANAGER_H
       6             : #define BITCOIN_NODE_SYNC_MANAGER_H
       7             : 
       8             : #include <masternode/sync.h>
       9             : #include <net_processing.h>
      10             : 
      11             : class CGovernanceManager;
      12             : class CMasternodeSync;
      13             : class CNetFulfilledRequestManager;
      14             : 
      15             : class SyncManager final : public NetHandler
      16             : {
      17             : public:
      18           0 :     SyncManager(PeerManagerInternal* peer_manager, CGovernanceManager& gov_manager, CMasternodeSync& node_sync, CConnman& connman,
      19             :                   CNetFulfilledRequestManager& netfulfilledman) :
      20           0 :         NetHandler(peer_manager),
      21           0 :         m_gov_manager(gov_manager),
      22           0 :         m_node_sync(node_sync),
      23           0 :         m_connman(connman),
      24           0 :         m_netfulfilledman(netfulfilledman)
      25           0 :     {
      26           0 :     }
      27             :     void Schedule(CScheduler& scheduler) override;
      28             :     void ProcessMessage(CNode& peer, const std::string& msg_type, CDataStream& vRecv) override;
      29             : 
      30             : private:
      31             :     void SendGovernanceSyncRequest(CNode* pnode) const;
      32             :     void SendGovernanceObjectSyncRequest(CNode* pnode, const uint256& nHash, bool fUseFilter) const;
      33             :     int RequestGovernanceObjectVotes(const std::vector<CNode*>& vNodesCopy) const;
      34             :     void ProcessTick();
      35             : 
      36             :     CGovernanceManager& m_gov_manager;
      37             :     CMasternodeSync& m_node_sync;
      38             :     CConnman& m_connman;
      39             :     CNetFulfilledRequestManager& m_netfulfilledman;
      40             : };
      41             : 
      42             : class NodeSyncNotifierImpl : public NodeSyncNotifier
      43             : {
      44             : public:
      45         368 :     NodeSyncNotifierImpl(CConnman& connman, CNetFulfilledRequestManager& netfulfilledman) :
      46         184 :         m_connman(connman),
      47         184 :         m_netfulfilledman(netfulfilledman)
      48         552 :     {}
      49             : 
      50             :     void SyncReset() override;
      51             :     void SyncFinished() override;
      52             : private:
      53             :     CConnman& m_connman;
      54             :     CNetFulfilledRequestManager& m_netfulfilledman;
      55             : };
      56             : #endif // BITCOIN_NODE_SYNC_MANAGER_H

Generated by: LCOV version 1.16