deploymentinfo.h raw

   1  // Copyright (c) 2016-2021 The Limenka 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 LIMENKA_DEPLOYMENTINFO_H
   6  #define LIMENKA_DEPLOYMENTINFO_H
   7  
   8  #include <consensus/params.h>
   9  
  10  #include <optional>
  11  #include <string>
  12  
  13  struct VBDeploymentInfo {
  14      /** Deployment name */
  15      const char *name;
  16      /** Whether GBT clients can safely ignore this rule in simplified usage */
  17      bool gbt_force;
  18  };
  19  
  20  extern const VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS];
  21  
  22  std::string DeploymentName(Consensus::BuriedDeployment dep);
  23  
  24  inline std::string DeploymentName(Consensus::DeploymentPos pos)
  25  {
  26      assert(Consensus::ValidDeployment(pos));
  27      return VersionBitsDeploymentInfo[pos].name;
  28  }
  29  
  30  std::optional<Consensus::BuriedDeployment> GetBuriedDeployment(const std::string_view deployment_name);
  31  
  32  #endif // LIMENKA_DEPLOYMENTINFO_H
  33