From 1d6ce0d0728aae230f6159a47a3e27f50df24fc5 Mon Sep 17 00:00:00 2001 From: Cy Rossignol Date: Mon, 1 Jun 2020 19:31:19 -0500 Subject: [PATCH] Add preliminary testing option for block v11 height on testnet This allows for configuration of the testnet block version 11 transition height for early testing of hard fork changes. Specify -v11height=X from the command line or add the directive to the configuration file to start a node that will switch to the block version 11 protocol after the chain grows to X number of blocks. --- src/init.cpp | 2 ++ src/main.h | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 2850d61657..5af69fda6f 100755 --- a/src/init.cpp +++ b/src/init.cpp @@ -533,6 +533,8 @@ bool AppInit2(ThreadHandlerPtr threads) } } + LogPrintf("Block version 11 hard fork configured for %d", GetV11Threshold()); + if (NN::Quorum::Active()) { LogPrintf("INFO: Native C++ neural network is active."); diff --git a/src/main.h b/src/main.h index 1840243fb9..57cf0cf756 100644 --- a/src/main.h +++ b/src/main.h @@ -123,9 +123,16 @@ inline bool IsV10Enabled(int nHeight) inline int32_t GetV11Threshold() { // Returns "never" before planned intro of bv11. - return fTestNet - ? std::numeric_limits::max() - : std::numeric_limits::max(); + try { + return fTestNet + // Temporary: configure testnet v11 height via parameter before + // releasing v11 to regular testnet: + // + ? std::stoi(GetArg("-v11height", "")) + : std::numeric_limits::max(); + } catch (...) { + return std::numeric_limits::max(); + } } inline bool IsV11Enabled(int nHeight)