diff --git a/doc/release-notes.md b/doc/release-notes.md --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -3,3 +3,5 @@ This release includes the following features and fixes: + - Removed 'softforks' information from `getblockchaininfo` RPC call, which + had only reported on some very old upgrades. diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1217,39 +1217,6 @@ nCheckDepth); } -/** Implementation of IsSuperMajority with better feedback */ -static UniValue SoftForkMajorityDesc(int version, const CBlockIndex *pindex, - const Consensus::Params &consensusParams) { - UniValue rv(UniValue::VOBJ); - bool activated = false; - switch (version) { - case 2: - activated = pindex->nHeight >= consensusParams.BIP34Height; - break; - case 3: - activated = pindex->nHeight >= consensusParams.BIP66Height; - break; - case 4: - activated = pindex->nHeight >= consensusParams.BIP65Height; - break; - case 5: - activated = pindex->nHeight >= consensusParams.CSVHeight; - break; - } - rv.pushKV("status", activated); - return rv; -} - -static UniValue SoftForkDesc(const std::string &name, int version, - const CBlockIndex *pindex, - const Consensus::Params &consensusParams) { - UniValue rv(UniValue::VOBJ); - rv.pushKV("id", name); - rv.pushKV("version", version); - rv.pushKV("reject", SoftForkMajorityDesc(version, pindex, consensusParams)); - return rv; -} - UniValue getblockchaininfo(const Config &config, const JSONRPCRequest &request) { if (request.fHelp || request.params.size() != 0) { @@ -1287,18 +1254,6 @@ "pruning is enabled (only present if pruning is enabled)\n" " \"prune_target_size\": xxxxxx, (numeric) the target size " "used by pruning (only present if automatic pruning is enabled)\n" - " \"softforks\": [ (array) status of softforks in " - "progress\n" - " {\n" - " \"id\": \"xxxx\", (string) name of softfork\n" - " \"version\": xx, (numeric) block version\n" - " \"reject\": { (object) progress toward " - "rejecting pre-softfork blocks\n" - " \"status\": xx, (boolean) true if threshold " - "reached\n" - " },\n" - " }, ...\n" - " ]\n" " \"warnings\" : \"...\", (string) any network and " "blockchain warnings.\n" "}\n" @@ -1341,15 +1296,6 @@ } } - const Consensus::Params &consensusParams = - config.GetChainParams().GetConsensus(); - UniValue softforks(UniValue::VARR); - softforks.push_back(SoftForkDesc("bip34", 2, tip, consensusParams)); - softforks.push_back(SoftForkDesc("bip66", 3, tip, consensusParams)); - softforks.push_back(SoftForkDesc("bip65", 4, tip, consensusParams)); - softforks.push_back(SoftForkDesc("csv", 5, tip, consensusParams)); - obj.pushKV("softforks", softforks); - obj.pushKV("warnings", GetWarnings("statusbar")); return obj; } diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py --- a/test/functional/feature_bip68_sequence.py +++ b/test/functional/feature_bip68_sequence.py @@ -403,11 +403,8 @@ self.nodes[0].generate(10) def get_csv_status(self): - softforks = self.nodes[0].getblockchaininfo()['softforks'] - for sf in softforks: - if sf['id'] == 'csv' and sf['version'] == 5: - return sf['reject']['status'] - raise AssertionError('Cannot find CSV fork activation information') + height = self.nodes[0].getblockchaininfo()['blocks'] + return height >= 576 # Make sure that BIP68 isn't being used to validate blocks, prior to # versionbits activation. If more blocks are mined prior to this test diff --git a/test/functional/feature_csv_activation.py b/test/functional/feature_csv_activation.py --- a/test/functional/feature_csv_activation.py +++ b/test/functional/feature_csv_activation.py @@ -103,11 +103,8 @@ def get_csv_status(node): - softforks = node.getblockchaininfo()['softforks'] - for sf in softforks: - if sf['id'] == 'csv' and sf['version'] == 5: - return sf['reject']['status'] - raise AssertionError('Cannot find CSV fork activation information') + height = node.getblockchaininfo()['blocks'] + return height >= 576 class BIP68_112_113Test(ComparisonTestFramework): diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -66,7 +66,6 @@ 'mediantime', 'pruned', 'size_on_disk', - 'softforks', 'verificationprogress', 'warnings', ]