Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 1,266 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
" \"id\": \"xxxx\", (string) name of softfork\n" | " \"id\": \"xxxx\", (string) name of softfork\n" | ||||
" \"version\": xx, (numeric) block version\n" | " \"version\": xx, (numeric) block version\n" | ||||
" \"reject\": { (object) progress toward " | " \"reject\": { (object) progress toward " | ||||
"rejecting pre-softfork blocks\n" | "rejecting pre-softfork blocks\n" | ||||
" \"status\": xx, (boolean) true if threshold " | " \"status\": xx, (boolean) true if threshold " | ||||
"reached\n" | "reached\n" | ||||
" },\n" | " },\n" | ||||
" }, ...\n" | " }, ...\n" | ||||
" ],\n" | " ]\n" | ||||
" \"bip9_softforks\": { (object) status of BIP9 " | |||||
"softforks in progress\n" | |||||
" \"xxxx\" : { (string) name of the softfork\n" | |||||
" \"status\": \"xxxx\", (string) one of \"defined\", " | |||||
"\"started\", \"locked_in\", \"active\", \"failed\"\n" | |||||
" \"bit\": xx, (numeric) the bit (0-28) in the " | |||||
"block version field used to signal this softfork (only for " | |||||
"\"started\" status)\n" | |||||
" \"startTime\": xx, (numeric) the minimum median " | |||||
"time past of a block at which the bit gains its meaning\n" | |||||
" \"timeout\": xx, (numeric) the median time past " | |||||
"of a block at which the deployment is considered failed if not " | |||||
"yet locked in\n" | |||||
" \"since\": xx (numeric) height of the first " | |||||
"block to which the status applies\n" | |||||
" }\n" | |||||
" }\n" | |||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getblockchaininfo", "") + | HelpExampleCli("getblockchaininfo", "") + | ||||
HelpExampleRpc("getblockchaininfo", "")); | HelpExampleRpc("getblockchaininfo", "")); | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
Show All 13 Lines | obj.push_back( | ||||
chainActive.Tip()))); | chainActive.Tip()))); | ||||
obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex())); | obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex())); | ||||
obj.push_back(Pair("pruned", fPruneMode)); | obj.push_back(Pair("pruned", fPruneMode)); | ||||
const Consensus::Params &consensusParams = | const Consensus::Params &consensusParams = | ||||
config.GetChainParams().GetConsensus(); | config.GetChainParams().GetConsensus(); | ||||
CBlockIndex *tip = chainActive.Tip(); | CBlockIndex *tip = chainActive.Tip(); | ||||
UniValue softforks(UniValue::VARR); | UniValue softforks(UniValue::VARR); | ||||
UniValue bip9_softforks(UniValue::VOBJ); | |||||
softforks.push_back(SoftForkDesc("bip34", 2, tip, consensusParams)); | softforks.push_back(SoftForkDesc("bip34", 2, tip, consensusParams)); | ||||
softforks.push_back(SoftForkDesc("bip66", 3, tip, consensusParams)); | softforks.push_back(SoftForkDesc("bip66", 3, tip, consensusParams)); | ||||
softforks.push_back(SoftForkDesc("bip65", 4, tip, consensusParams)); | softforks.push_back(SoftForkDesc("bip65", 4, tip, consensusParams)); | ||||
softforks.push_back(SoftForkDesc("csv", 5, tip, consensusParams)); | softforks.push_back(SoftForkDesc("csv", 5, tip, consensusParams)); | ||||
BIP9SoftForkDescPushBack(bip9_softforks, "csv", consensusParams, | BIP9SoftForkDescPushBack(bip9_softforks, "csv", consensusParams, | ||||
Consensus::DEPLOYMENT_CSV); | Consensus::DEPLOYMENT_CSV); | ||||
obj.push_back(Pair("softforks", softforks)); | obj.push_back(Pair("softforks", softforks)); | ||||
obj.push_back(Pair("bip9_softforks", bip9_softforks)); | |||||
if (fPruneMode) { | if (fPruneMode) { | ||||
CBlockIndex *block = chainActive.Tip(); | CBlockIndex *block = chainActive.Tip(); | ||||
while (block && block->pprev && block->pprev->nStatus.hasData()) { | while (block && block->pprev && block->pprev->nStatus.hasData()) { | ||||
block = block->pprev; | block = block->pprev; | ||||
} | } | ||||
obj.push_back(Pair("pruneheight", block->nHeight)); | obj.push_back(Pair("pruneheight", block->nHeight)); | ||||
▲ Show 20 Lines • Show All 430 Lines • Show Last 20 Lines |