rpc: getdeploymentinfo: include signalling info

This commit is contained in:
Anthony Towns
2021-11-12 07:14:21 +10:00
parent 376c0c6dae
commit 240cad09ba
5 changed files with 49 additions and 15 deletions

View File

@@ -64,8 +64,10 @@ protected:
virtual int Threshold(const Consensus::Params& params) const =0;
public:
/** Returns the numerical statistics of an in-progress BIP9 softfork in the period including pindex */
BIP9Stats GetStateStatisticsFor(const CBlockIndex* pindex, const Consensus::Params& params) const;
/** Returns the numerical statistics of an in-progress BIP9 softfork in the period including pindex
* If provided, signalling_blocks is set to true/false based on whether each block in the period signalled
*/
BIP9Stats GetStateStatisticsFor(const CBlockIndex* pindex, const Consensus::Params& params, std::vector<bool>* signalling_blocks = nullptr) const;
/** Returns the state for pindex A based on parent pindexPrev B. Applies any state transition if conditions are present.
* Caches state from first block of period. */
ThresholdState GetStateFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const;
@@ -82,8 +84,10 @@ private:
ThresholdConditionCache m_caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] GUARDED_BY(m_mutex);
public:
/** Get the numerical statistics for a given deployment for the signalling period that includes pindex. */
static BIP9Stats Statistics(const CBlockIndex* pindex, const Consensus::Params& params, Consensus::DeploymentPos pos);
/** Get the numerical statistics for a given deployment for the signalling period that includes pindex.
* If provided, signalling_blocks is set to true/false based on whether each block in the period signalled
*/
static BIP9Stats Statistics(const CBlockIndex* pindex, const Consensus::Params& params, Consensus::DeploymentPos pos, std::vector<bool>* signalling_blocks = nullptr);
static uint32_t Mask(const Consensus::Params& params, Consensus::DeploymentPos pos);