aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-09-11 16:32:46 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-09-25 21:16:35 +0100
commitcdbbe99c829a5169a31386ef65400050f207170f (patch)
tree5f38127fa220bf529d89f29249570e0974d94279 /src
parentserialization: add deque serialization (diff)
downloadmonero-cdbbe99c829a5169a31386ef65400050f207170f.tar.xz
checkpoints: add a token checkpoint on testnet (the genesis block)
Diffstat (limited to 'src')
-rw-r--r--src/checkpoints/checkpoints.cpp8
-rw-r--r--src/checkpoints/checkpoints.h3
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp2
3 files changed, 10 insertions, 3 deletions
diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp
index 60be7f7ec..bea392db0 100644
--- a/src/checkpoints/checkpoints.cpp
+++ b/src/checkpoints/checkpoints.cpp
@@ -136,8 +136,14 @@ namespace cryptonote
return true;
}
- bool checkpoints::init_default_checkpoints()
+ bool checkpoints::init_default_checkpoints(bool testnet)
{
+ if (testnet)
+ {
+ // just use the genesis block on testnet
+ ADD_CHECKPOINT(0, "48ca7cd3c8de5b6a4d53d2861fbdaedca141553559f9be9520068053cda8430b");
+ return true;
+ }
ADD_CHECKPOINT(1, "771fbcd656ec1464d3a02ead5e18644030007a0fc664c0a964d30922821a8148");
ADD_CHECKPOINT(10, "c0e3b387e47042f72d8ccdca88071ff96bff1ac7cde09ae113dbb7ad3fe92381");
ADD_CHECKPOINT(100, "ac3e11ca545e57c49fca2b4e8c48c03c23be047c43e471e1394528b1f9f80b2d");
diff --git a/src/checkpoints/checkpoints.h b/src/checkpoints/checkpoints.h
index 72eb232d7..a643c5790 100644
--- a/src/checkpoints/checkpoints.h
+++ b/src/checkpoints/checkpoints.h
@@ -148,10 +148,11 @@ namespace cryptonote
/**
* @brief loads the default main chain checkpoints
+ * @param testnet whether to load testnet checkpoints or mainnet
*
* @return true unless adding a checkpoint fails
*/
- bool init_default_checkpoints();
+ bool init_default_checkpoints(bool testnet);
/**
* @brief load new checkpoints
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 2de084d7e..57347fdbc 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -183,7 +183,7 @@ namespace cryptonote
if (!m_testnet && !m_fakechain)
{
cryptonote::checkpoints checkpoints;
- if (!checkpoints.init_default_checkpoints())
+ if (!checkpoints.init_default_checkpoints(m_testnet))
{
throw std::runtime_error("Failed to initialize checkpoints");
}