diff --git a/src/consensus/activation.cpp b/src/consensus/activation.cpp index 80f726132f..0bf39b78b0 100644 --- a/src/consensus/activation.cpp +++ b/src/consensus/activation.cpp @@ -1,60 +1,70 @@ // Copyright (c) 2018 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include #include #include #include static bool IsUAHFenabled(const Consensus::Params ¶ms, int nHeight) { return nHeight >= params.uahfHeight; } bool IsUAHFenabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev) { if (pindexPrev == nullptr) { return false; } return IsUAHFenabled(params, pindexPrev->nHeight); } static bool IsDAAEnabled(const Consensus::Params ¶ms, int nHeight) { return nHeight >= params.daaHeight; } bool IsDAAEnabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev) { if (pindexPrev == nullptr) { return false; } return IsDAAEnabled(params, pindexPrev->nHeight); } bool IsMagneticAnomalyEnabled(const Consensus::Params ¶ms, int32_t nHeight) { return nHeight >= params.magneticAnomalyHeight; } bool IsMagneticAnomalyEnabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev) { if (pindexPrev == nullptr) { return false; } return IsMagneticAnomalyEnabled(params, pindexPrev->nHeight); } bool IsGravitonEnabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev) { if (pindexPrev == nullptr) { return false; } return pindexPrev->GetMedianTimePast() >= gArgs.GetArg("-gravitonactivationtime", params.gravitonActivationTime); } + +bool IsPhononEnabled(const Consensus::Params ¶ms, + const CBlockIndex *pindexPrev) { + if (pindexPrev == nullptr) { + return false; + } + + return pindexPrev->GetMedianTimePast() >= + gArgs.GetArg("-phononactivationtime", params.phononActivationTime); +} diff --git a/src/consensus/activation.h b/src/consensus/activation.h index 2fd3628cf9..bbf5acf987 100644 --- a/src/consensus/activation.h +++ b/src/consensus/activation.h @@ -1,35 +1,39 @@ // Copyright (c) 2018 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_ACTIVATION_H #define BITCOIN_CONSENSUS_ACTIVATION_H #include class CBlockIndex; class Config; namespace Consensus { struct Params; } /** Check if UAHF has activated. */ bool IsUAHFenabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev); /** Check if DAA HF has activated. */ bool IsDAAEnabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev); /** Check if Nov 15, 2018 HF has activated using block height. */ bool IsMagneticAnomalyEnabled(const Consensus::Params ¶ms, int32_t nHeight); /** Check if Nov 15, 2018 HF has activated using previous block index. */ bool IsMagneticAnomalyEnabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev); /** Check if Nov 15th, 2019 protocol upgrade has activated. */ bool IsGravitonEnabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev); +/** Check if May 15th, 2020 protocol upgrade has activated. */ +bool IsPhononEnabled(const Consensus::Params ¶ms, + const CBlockIndex *pindexPrev); + #endif // BITCOIN_CONSENSUS_ACTIVATION_H diff --git a/src/init.cpp b/src/init.cpp index d01837bf3f..153dda784f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,2499 +1,2502 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include