Update testnet, remove testnet forks, remove checkpoints, update blockheight estimate (#212)

This commit is contained in:
Doyle 2018-09-06 12:26:09 +10:00 committed by GitHub
parent 0494e64587
commit 73fece75ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 38 deletions

View file

@ -166,8 +166,6 @@ namespace cryptonote
case STAGENET:
break;
case TESTNET:
ADD_CHECKPOINT(3591, "2b6e72fe1b3f0803667fe24cabc31aaa1ca28e49c726872fda41eda2b648e790");
ADD_CHECKPOINT(4166, "b02dcb4427a11d7287461efa000849400097e007ee8d485e5c4943d782da34a1");
break;
case FAKECHAIN:
break;

View file

@ -190,13 +190,13 @@ namespace config
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 156;
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 157;
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 158;
uint16_t const P2P_DEFAULT_PORT = 38150;
uint16_t const RPC_DEFAULT_PORT = 38151;
uint16_t const ZMQ_RPC_DEFAULT_PORT = 38152;
uint16_t const P2P_DEFAULT_PORT = 38156;
uint16_t const RPC_DEFAULT_PORT = 38157;
uint16_t const ZMQ_RPC_DEFAULT_PORT = 38158;
boost::uuids::uuid const NETWORK_ID = { {
0x5e, 0x3a, 0x78, 0x65, 0xe1, 0x6f, 0xca, 0xb8, 0x02, 0xa1, 0xdc, 0x17, 0x61, 0x64, 0x15, 0xbd,
0x5f, 0x3a, 0x78, 0x65, 0xe1, 0x6f, 0xca, 0xb8, 0x02, 0xa1, 0xdc, 0x17, 0x61, 0x64, 0x15, 0xbe,
} }; // Bender's daydream
std::string const GENESIS_TX = "03011e001e01ff00018080c9db97f4fb2702086d7c46917916b9e0401d68ab284d65e0af02ffbfa07853ce1286fda7430ad442017f0f2bbd2ea9c40e20efb4b091750cd4d95c470d34788459751d0d82c9eb137f72000000000000000000000000000000000000000000000000000000000000000000";
std::string const GENESIS_TX = "03011e001e01ff00018080c9db97f4fb270259b546996f69aa71abe4238995f41d780ab1abebcac9f00e808f147bdb9e3228420112573af8c309b69a1a646f41b5212ba7d9c4590bf86e04f36c486467cfef9d3d72000000000000000000000000000000000000000000000000000000000000000000";
uint32_t const GENESIS_NONCE = 10001;
std::string const GOVERNANCE_WALLET_ADDRESS = "T6SUprTYE5rQpep9iQFxyPcKVd91DFR1fQ1Qsyqp5eYLiFc8XuYd3reRE71qDL8c3DXioUbDEpDFdaUpetnL37NS1R3rzoKxi";

View file

@ -3057,34 +3057,8 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
}
// Check if deregister is too old or too new to hold onto
{
const uint64_t curr_height = get_current_blockchain_height();
if (m_nettype == TESTNET && curr_height < 7250)
{
if (deregister.block_height > curr_height)
{
LOG_PRINT_L1("Received deregister tx for height: " << deregister.block_height
<< " and service node: " << deregister.service_node_index
<< ", is newer than current height: " << curr_height
<< " blocks and has been rejected.");
tvc.m_vote_ctx.m_invalid_block_height = true;
tvc.m_verifivation_failed = true;
return false;
}
uint64_t delta_height = curr_height - deregister.block_height;
if (delta_height > loki::service_node_deregister::DEREGISTER_LIFETIME_BY_HEIGHT)
{
LOG_PRINT_L1("Received deregister tx for height: " << deregister.block_height
<< " and service node: " << deregister.service_node_index
<< ", is older than: " << loki::service_node_deregister::DEREGISTER_LIFETIME_BY_HEIGHT
<< " blocks and has been rejected. The current height is: " << curr_height);
tvc.m_vote_ctx.m_invalid_block_height = true;
tvc.m_verifivation_failed = true;
return false;
}
}
else
{
if (deregister.block_height >= curr_height)
{
LOG_PRINT_L1("Received deregister tx for height: " << deregister.block_height

View file

@ -295,7 +295,7 @@ namespace cryptonote
auto data_dir = boost::filesystem::path(m_config_folder);
if (m_nettype == MAINNET || m_nettype == TESTNET)
if (m_nettype == MAINNET)
{
cryptonote::checkpoints checkpoints;
if (!checkpoints.init_default_checkpoints(m_nettype))

View file

@ -372,7 +372,7 @@ namespace nodetool
std::set<std::string> full_addrs;
if (nettype == cryptonote::TESTNET)
{
full_addrs.insert("52.63.146.137:38150");
full_addrs.insert("52.63.146.137:38156");
}
else if (nettype == cryptonote::STAGENET)
{

View file

@ -1,5 +1,5 @@
#define DEF_LOKI_VERSION_TAG "@VERSIONTAG@"
#define DEF_LOKI_VERSION "0.3.7a-beta"
#define DEF_LOKI_VERSION "0.3.8-beta"
#define DEF_LOKI_RELEASE_NAME "Magic Mani"
#define DEF_LOKI_VERSION_FULL DEF_LOKI_VERSION "-" DEF_LOKI_VERSION_TAG

View file

@ -9163,7 +9163,7 @@ uint64_t wallet2::get_daemon_blockchain_target_height(string &err)
uint64_t wallet2::get_approximate_blockchain_height() const
{
const int seconds_per_block = DIFFICULTY_TARGET_V2;
const time_t epochTimeMiningStarted = (m_nettype == TESTNET ? 1535009385 : 1525067730) + (60 * 60 * 24 * 7); // 2018-04-30 ~3:55PM + 1 week to be conservative.
const time_t epochTimeMiningStarted = (m_nettype == TESTNET || m_nettype == STAGENET ? 1536137083 : 1525067730) + (60 * 60 * 24 * 7); // 2018-04-30 ~3:55PM + 1 week to be conservative.
const time_t currentTime = time(NULL);
uint64_t approx_blockchain_height = (currentTime < epochTimeMiningStarted) ? 0 : (currentTime - epochTimeMiningStarted)/seconds_per_block;
LOG_PRINT_L2("Calculated blockchain height: " << approx_blockchain_height);