LCOV - code coverage report
Current view: top level - src/consensus - params.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 10 13 76.9 %
Date: 2026-08-09 10:51:41 Functions: 2 2 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2019 The Zcash developers
       2             : // Copyright (c) 2020-2021 The PIVX Core developers
       3             : // Distributed under the MIT software license, see the accompanying
       4             : // file COPYING or https://www.opensource.org/licenses/mit-license.php .
       5             : 
       6             : #include "consensus/params.h"
       7             : #include "consensus/upgrades.h"
       8             : #include "util/system.h"
       9             : 
      10             : namespace Consensus {
      11             : 
      12     1264138 : bool Params::NetworkUpgradeActive(int nHeight, Consensus::UpgradeIndex idx) const
      13             : {
      14     1264138 :     if (idx >= Consensus::MAX_NETWORK_UPGRADES)
      15           0 :         return error("%s: Upgrade index out of bounds: %d >= %d",
      16           0 :                 __func__, idx, Consensus::MAX_NETWORK_UPGRADES);
      17             : 
      18     1264138 :     if (nHeight < 0)
      19          18 :         return error("%s: Requested state for upgrade %s at negative height %d",
      20          18 :                 __func__, NetworkUpgradeInfo[idx].strName, nHeight);
      21             : 
      22     1264118 :     return NetworkUpgradeState(nHeight, *this, idx) == UPGRADE_ACTIVE;
      23             : }
      24             : 
      25         744 : Optional<LLMQParams> Params::GetLLMQParams(uint8_t llmqtype) const
      26             : {
      27         744 :     const auto it = llmqs.find((LLMQType)llmqtype);
      28         744 :     if (it == llmqs.end()) {
      29           0 :         return nullopt;
      30             :     }
      31         744 :     return Optional<LLMQParams>(it->second);
      32             : }
      33             : 
      34             : } // End consensus namespace

Generated by: LCOV version 1.14