LCOV - code coverage report
Current view: top level - src/llmq - observer.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 14 15 93.3 %
Date: 2026-06-25 07:23:43 Functions: 6 7 85.7 %

          Line data    Source code
       1             : // Copyright (c) 2025-2026 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             : #include <llmq/observer.h>
       6             : 
       7             : #include <llmq/debug.h>
       8             : #include <llmq/dkgsessionmgr.h>
       9             : 
      10             : namespace llmq {
      11          18 : ObserverContext::ObserverContext(CDeterministicMNManager& dmnman, llmq::CQuorumManager& qman,
      12             :                                  llmq::CQuorumSnapshotManager& qsnapman, const ChainstateManager& chainman,
      13             :                                  const CSporkManager& sporkman, const util::DbWrapperParams& db_params) :
      14           6 :     QuorumRole{qman},
      15           6 :     dkgdbgman{std::make_unique<llmq::CDKGDebugManager>(dmnman, qsnapman, chainman)},
      16           6 :     qdkgsman{std::make_unique<llmq::CDKGSessionManager>(dmnman, qsnapman, chainman, sporkman, db_params)}
      17          18 : {
      18          12 : }
      19             : 
      20          12 : ObserverContext::~ObserverContext() = default;
      21             : 
      22           6 : void ObserverContext::InitializeCurrentBlockTip(const CBlockIndex* tip, bool ibd)
      23             : {
      24           6 :     UpdatedBlockTip(tip, nullptr, ibd);
      25           6 : }
      26             : 
      27           6 : void ObserverContext::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
      28             : {
      29           6 :     if (fInitialDownload || pindexNew == pindexFork) // In IBD or blocks were disconnected without any new ones
      30           0 :         return;
      31             : 
      32           6 :     qdkgsman->UpdatedBlockTip(pindexNew, fInitialDownload);
      33           6 : }
      34             : } // namespace llmq

Generated by: LCOV version 1.16