Update example to use real network upgrade functions

This commit is contained in:
str4d 2018-02-05 01:00:14 +00:00
parent 065a4a6b96
commit 1f04e2745b
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with 3 additions and 3 deletions

View File

@ -118,15 +118,15 @@ by block height checks. For example:
.. code:: cpp
if (chainActive.Tip()->nHeight >= OVERWINTER.ACTIVATION_HEIGHT) {
if (CurrentEpoch(chainActive.Height(), Params().GetConsensus()) == Consensus::UPGRADE_OVERWINTER) {
// Overwinter-specific logic
} else {
// Pre-Overwinter logic
// Non-Overwinter logic
}
// ...
if (pindex->nHeight >= OVERWINTER.ACTIVATION_HEIGHT) {
if (NetworkUpgradeActive(pindex->nHeight, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) {
// Overwinter consensus rules applied to block
} else {
// Pre-Overwinter consensus rules applied to block