Skip to content

Commit

Permalink
Add preliminary testing option for block v11 height on testnet
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cyrossignol committed Jun 2, 2020
1 parent ae4b40f commit 1d6ce0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
13 changes: 10 additions & 3 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t>::max()
: std::numeric_limits<int32_t>::max();
try {
return fTestNet
// Temporary: configure testnet v11 height via parameter before
// releasing v11 to regular testnet:
//
? std::stoi(GetArg("-v11height", ""))
: std::numeric_limits<int32_t>::max();
} catch (...) {
return std::numeric_limits<int32_t>::max();
}
}

inline bool IsV11Enabled(int nHeight)
Expand Down

0 comments on commit 1d6ce0d

Please sign in to comment.