text: // Copyright (c) 2018-2019 The Bitcoin developers
  // Distributed under the MIT software license, see the accompanying
  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  
  #include <consensus/activation.h>
  
  #include <chain.h>
  #include <consensus/params.h>
  #include <util/system.h>
  
  static bool IsUAHFenabled(const Consensus::Params &params, int nHeight) {
      return nHeight >= params.uahfHeight;
  }
  
  bool IsUAHFenabled(const Consensus::Params &params,
                     const CBlockIndex *pindexPrev) {
      if (pindexPrev == nullptr) {
          return false;
      }
  
      return IsUAHFenabled(params, pindexPrev->nHeight);
  }
  
  static bool IsDAAEnabled(const Consensus::Params &params, int nHeight) {
      return nHeight >= params.daaHeight;
  }
  
  bool IsDAAEnabled(const Consensus::Params &params,
                    const CBlockIndex *pindexPrev) {
      if (pindexPrev == nullptr) {
          return false;
      }
  
      return IsDAAEnabled(params, pindexPrev->nHeight);
  }
  
  bool IsMagneticAnomalyEnabled(const Consensus::Params &params,
                                int32_t nHeight) {
      return nHeight >= params.magneticAnomalyHeight;
  }
  
  bool IsMagneticAnomalyEnabled(const Consensus::Params &params,
                                const CBlockIndex *pindexPrev) {
      if (pindexPrev == nullptr) {
          return false;
      }
  
      return IsMagneticAnomalyEnabled(params, pindexPrev->nHeight);
  }
  
  static bool IsGravitonEnabled(const Consensus::Params &params,
                                int32_t nHeight) {
      return nHeight >= params.gravitonHeight;
  }
  
  bool IsGravitonEnabled(const Consensus::Params &params,
                         const CBlockIndex *pindexPrev) {
      if (pindexPrev == nullptr) {
          return false;
      }
  
      return IsGravitonEnabled(params, pindexPrev->nHeight);
  }
  
  bool IsPhononEnabled(const Consensus::Params &params,
                       const CBlockIndex *pindexPrev) {
      if (pindexPrev == nullptr) {
          return false;
      }
  
      return pindexPrev->GetMedianTimePast() >=
             gArgs.GetArg("-phononactivationtime", params.phononActivationTime);
  }
  
  bool IsAxionEnabled(const Consensus::Params &params,
                      const CBlockIndex *pindexPrev) {
      if (pindexPrev == nullptr) {
          return false;
      }
  
      return pindexPrev->GetMedianTimePast() >=
             gArgs.GetArg("-axionactivationtime", params.axionActivationTime);
  }
  