mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-01 19:35:52 +02:00
validation: move g_versionbitscache into ChainstateManager
This commit is contained in:
@@ -1099,8 +1099,8 @@ static void SoftForkDescPushBack(const CBlockIndex* blockindex, UniValue& softfo
|
||||
|
||||
UniValue bip9(UniValue::VOBJ);
|
||||
|
||||
const ThresholdState next_state = g_versionbitscache.State(blockindex, chainman.GetConsensus(), id);
|
||||
const ThresholdState current_state = g_versionbitscache.State(blockindex->pprev, chainman.GetConsensus(), id);
|
||||
const ThresholdState next_state = chainman.m_versionbitscache.State(blockindex, chainman.GetConsensus(), id);
|
||||
const ThresholdState current_state = chainman.m_versionbitscache.State(blockindex->pprev, chainman.GetConsensus(), id);
|
||||
|
||||
const bool has_signal = (ThresholdState::STARTED == current_state || ThresholdState::LOCKED_IN == current_state);
|
||||
|
||||
@@ -1114,14 +1114,14 @@ static void SoftForkDescPushBack(const CBlockIndex* blockindex, UniValue& softfo
|
||||
|
||||
// BIP9 status
|
||||
bip9.pushKV("status", get_state_name(current_state));
|
||||
bip9.pushKV("since", g_versionbitscache.StateSinceHeight(blockindex->pprev, chainman.GetConsensus(), id));
|
||||
bip9.pushKV("since", chainman.m_versionbitscache.StateSinceHeight(blockindex->pprev, chainman.GetConsensus(), id));
|
||||
bip9.pushKV("status_next", get_state_name(next_state));
|
||||
|
||||
// BIP9 signalling status, if applicable
|
||||
if (has_signal) {
|
||||
UniValue statsUV(UniValue::VOBJ);
|
||||
std::vector<bool> signals;
|
||||
BIP9Stats statsStruct = g_versionbitscache.Statistics(blockindex, chainman.GetConsensus(), id, &signals);
|
||||
BIP9Stats statsStruct = chainman.m_versionbitscache.Statistics(blockindex, chainman.GetConsensus(), id, &signals);
|
||||
statsUV.pushKV("period", statsStruct.period);
|
||||
statsUV.pushKV("elapsed", statsStruct.elapsed);
|
||||
statsUV.pushKV("count", statsStruct.count);
|
||||
@@ -1142,7 +1142,7 @@ static void SoftForkDescPushBack(const CBlockIndex* blockindex, UniValue& softfo
|
||||
UniValue rv(UniValue::VOBJ);
|
||||
rv.pushKV("type", "bip9");
|
||||
if (ThresholdState::ACTIVE == next_state) {
|
||||
rv.pushKV("height", g_versionbitscache.StateSinceHeight(blockindex, chainman.GetConsensus(), id));
|
||||
rv.pushKV("height", chainman.m_versionbitscache.StateSinceHeight(blockindex, chainman.GetConsensus(), id));
|
||||
}
|
||||
rv.pushKV("active", ThresholdState::ACTIVE == next_state);
|
||||
rv.pushKV("bip9", bip9);
|
||||
|
||||
Reference in New Issue
Block a user