diff options
Diffstat (limited to 'src/checkpoints')
-rw-r--r-- | src/checkpoints/checkpoints.cpp | 24 | ||||
-rw-r--r-- | src/checkpoints/checkpoints.h | 13 |
2 files changed, 25 insertions, 12 deletions
diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp index eadfb4df7..f709465c8 100644 --- a/src/checkpoints/checkpoints.cpp +++ b/src/checkpoints/checkpoints.cpp @@ -159,14 +159,20 @@ namespace cryptonote return true; } - bool checkpoints::init_default_checkpoints(bool testnet) + bool checkpoints::init_default_checkpoints(network_type nettype) { - if (testnet) + if (nettype == TESTNET) { ADD_CHECKPOINT(0, "48ca7cd3c8de5b6a4d53d2861fbdaedca141553559f9be9520068053cda8430b"); ADD_CHECKPOINT(1000000, "46b690b710a07ea051bc4a6b6842ac37be691089c0f7758cfeec4d5fc0b4a258"); return true; } + if (nettype == STAGENET) + { + ADD_CHECKPOINT(0, "76ee3cc98646292206cd3e86f74d88b4dcc1d937088645e9b0cbca84b7ce74eb"); + ADD_CHECKPOINT(10000, "1f8b0ce313f8b9ba9a46108bfd285c45ad7c2176871fd41c3a690d4830ce2fd5"); + return true; + } ADD_CHECKPOINT(1, "771fbcd656ec1464d3a02ead5e18644030007a0fc664c0a964d30922821a8148"); ADD_CHECKPOINT(10, "c0e3b387e47042f72d8ccdca88071ff96bff1ac7cde09ae113dbb7ad3fe92381"); ADD_CHECKPOINT(100, "ac3e11ca545e57c49fca2b4e8c48c03c23be047c43e471e1394528b1f9f80b2d"); @@ -240,7 +246,7 @@ namespace cryptonote return true; } - bool checkpoints::load_checkpoints_from_dns(bool testnet) + bool checkpoints::load_checkpoints_from_dns(network_type nettype) { std::vector<std::string> records; @@ -257,7 +263,13 @@ namespace cryptonote , "testpoints.moneropulse.co" }; - if (!tools::dns_utils::load_txt_records_from_dns(records, testnet ? testnet_dns_urls : dns_urls)) + static const std::vector<std::string> stagenet_dns_urls = { "stagenetpoints.moneropulse.se" + , "stagenetpoints.moneropulse.org" + , "stagenetpoints.moneropulse.net" + , "stagenetpoints.moneropulse.co" + }; + + if (!tools::dns_utils::load_txt_records_from_dns(records, nettype == TESTNET ? testnet_dns_urls : nettype == STAGENET ? stagenet_dns_urls : dns_urls)) return true; // why true ? for (const auto& record : records) @@ -290,14 +302,14 @@ namespace cryptonote return true; } - bool checkpoints::load_new_checkpoints(const std::string &json_hashfile_fullpath, bool testnet, bool dns) + bool checkpoints::load_new_checkpoints(const std::string &json_hashfile_fullpath, network_type nettype, bool dns) { bool result; result = load_checkpoints_from_json(json_hashfile_fullpath); if (dns) { - result &= load_checkpoints_from_dns(testnet); + result &= load_checkpoints_from_dns(nettype); } return result; diff --git a/src/checkpoints/checkpoints.h b/src/checkpoints/checkpoints.h index e71861c44..61be2c27a 100644 --- a/src/checkpoints/checkpoints.h +++ b/src/checkpoints/checkpoints.h @@ -33,6 +33,7 @@ #include <vector> #include "misc_log_ex.h" #include "crypto/hash.h" +#include "cryptonote_config.h" #define ADD_CHECKPOINT(h, hash) CHECK_AND_ASSERT(add_checkpoint(h, hash), false); #define JSON_HASH_FILE_NAME "checkpoints.json" @@ -147,11 +148,11 @@ namespace cryptonote /** * @brief loads the default main chain checkpoints - * @param testnet whether to load testnet checkpoints or mainnet + * @param nettype network type * * @return true unless adding a checkpoint fails */ - bool init_default_checkpoints(bool testnet); + bool init_default_checkpoints(network_type nettype); /** * @brief load new checkpoints @@ -160,12 +161,12 @@ namespace cryptonote * (optionally) from DNS. * * @param json_hashfile_fullpath path to the json checkpoints file - * @param testnet whether to load testnet checkpoints or mainnet + * @param nettype network type * @param dns whether or not to load DNS checkpoints * * @return true if loading successful and no conflicts */ - bool load_new_checkpoints(const std::string &json_hashfile_fullpath, bool testnet=false, bool dns=true); + bool load_new_checkpoints(const std::string &json_hashfile_fullpath, network_type nettype=MAINNET, bool dns=true); /** * @brief load new checkpoints from json @@ -179,11 +180,11 @@ namespace cryptonote /** * @brief load new checkpoints from DNS * - * @param testnet whether to load testnet checkpoints or mainnet + * @param nettype network type * * @return true if loading successful and no conflicts */ - bool load_checkpoints_from_dns(bool testnet = false); + bool load_checkpoints_from_dns(network_type nettype = MAINNET); private: std::map<uint64_t, crypto::hash> m_points; //!< the checkpoints container |