Skip to content

Commit 5bdb2c0

Browse files
Revert "Show BIP9 progress in getblockchaininfo (#2435)"
This reverts commit 3685c85.
1 parent 1bb4b9c commit 5bdb2c0

File tree

3 files changed

+0
-37
lines changed

3 files changed

+0
-37
lines changed

src/rpc/blockchain.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,16 +1324,6 @@ static UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Conse
13241324
if (THRESHOLD_STARTED == thresholdState)
13251325
{
13261326
rv.push_back(Pair("bit", consensusParams.vDeployments[id].bit));
1327-
1328-
int nBlockCount = VersionBitsCountBlocksInWindow(chainActive.Tip(), consensusParams, id);
1329-
int64_t nPeriod = consensusParams.vDeployments[id].nWindowSize ? consensusParams.vDeployments[id].nWindowSize : consensusParams.nMinerConfirmationWindow;
1330-
int64_t nThreshold = consensusParams.vDeployments[id].nThreshold ? consensusParams.vDeployments[id].nThreshold : consensusParams.nRuleChangeActivationThreshold;
1331-
int64_t nWindowStart = chainActive.Height() - (chainActive.Height() % nPeriod);
1332-
rv.push_back(Pair("period", nPeriod));
1333-
rv.push_back(Pair("threshold", nThreshold));
1334-
rv.push_back(Pair("windowStart", nWindowStart));
1335-
rv.push_back(Pair("windowBlocks", nBlockCount));
1336-
rv.push_back(Pair("windowProgress", std::min(1.0, (double)nBlockCount / nThreshold)));
13371327
}
13381328
rv.push_back(Pair("startTime", consensusParams.vDeployments[id].nStartTime));
13391329
rv.push_back(Pair("timeout", consensusParams.vDeployments[id].nTimeout));
@@ -1392,11 +1382,6 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
13921382
" \"xxxx\" : { (string) name of the softfork\n"
13931383
" \"status\": \"xxxx\", (string) one of \"defined\", \"started\", \"locked_in\", \"active\", \"failed\"\n"
13941384
" \"bit\": xx, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for \"started\" status)\n"
1395-
" \"period\": xx, (numeric) the window size/period for this softfork (only for \"started\" status)\n"
1396-
" \"threshold\": xx, (numeric) the threshold for this softfork (only for \"started\" status)\n"
1397-
" \"windowStart\": xx, (numeric) the starting block height of the current window (only for \"started\" status)\n"
1398-
" \"windowBlocks\": xx, (numeric) the number of blocks in the current window that had the version bit set for this softfork (only for \"started\" status)\n"
1399-
" \"windowProgress\": xx, (numeric) the progress (between 0 and 1) for activation of this softfork (only for \"started\" status)\n"
14001385
" \"startTime\": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning\n"
14011386
" \"timeout\": xx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\n"
14021387
" \"since\": xx, (numeric) height of the first block to which the status applies\n"

src/versionbits.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,6 @@ int AbstractThresholdConditionChecker::GetStateSinceHeightFor(const CBlockIndex*
182182
return pindexPrev->nHeight + 1;
183183
}
184184

185-
int AbstractThresholdConditionChecker::CountBlocksInWindow(const CBlockIndex* pindex, const Consensus::Params& params) const
186-
{
187-
int nPeriod = Period(params);
188-
int nStopHeight = pindex->nHeight - (pindex->nHeight % nPeriod) - 1;
189-
const CBlockIndex* pindexCount = pindex;
190-
int count = 0;
191-
while (pindexCount && pindexCount->nHeight != nStopHeight) {
192-
if (Condition(pindexCount, params)) {
193-
count++;
194-
}
195-
pindexCount = pindexCount->pprev;
196-
}
197-
return count;
198-
}
199-
200185
namespace
201186
{
202187
/**
@@ -239,11 +224,6 @@ int VersionBitsStateSinceHeight(const CBlockIndex* pindexPrev, const Consensus::
239224
return VersionBitsConditionChecker(pos).GetStateSinceHeightFor(pindexPrev, params, cache.caches[pos]);
240225
}
241226

242-
int VersionBitsCountBlocksInWindow(const CBlockIndex* pindex, const Consensus::Params& params, Consensus::DeploymentPos pos)
243-
{
244-
return VersionBitsConditionChecker(pos).CountBlocksInWindow(pindex, params);
245-
}
246-
247227
uint32_t VersionBitsMask(const Consensus::Params& params, Consensus::DeploymentPos pos)
248228
{
249229
return VersionBitsConditionChecker(pos).Mask(params);

src/versionbits.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class AbstractThresholdConditionChecker {
6565
// Note that the functions below take a pindexPrev as input: they compute information for block B based on its parent.
6666
ThresholdState GetStateFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const;
6767
int GetStateSinceHeightFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const;
68-
int CountBlocksInWindow(const CBlockIndex* pindex, const Consensus::Params& params) const;
6968
};
7069

7170
struct VersionBitsCache
@@ -78,7 +77,6 @@ struct VersionBitsCache
7877
ThresholdState VersionBitsState(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos, VersionBitsCache& cache);
7978
BIP9Stats VersionBitsStatistics(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos);
8079
int VersionBitsStateSinceHeight(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos, VersionBitsCache& cache);
81-
int VersionBitsCountBlocksInWindow(const CBlockIndex* pindex, const Consensus::Params& params, Consensus::DeploymentPos pos);
8280
uint32_t VersionBitsMask(const Consensus::Params& params, Consensus::DeploymentPos pos);
8381

8482
#endif

0 commit comments

Comments
 (0)