Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show All 18 Lines | |||||
#include "rpc/server.h" | #include "rpc/server.h" | ||||
#include "streams.h" | #include "streams.h" | ||||
#include "sync.h" | #include "sync.h" | ||||
#include "txdb.h" | #include "txdb.h" | ||||
#include "txmempool.h" | #include "txmempool.h" | ||||
#include "util.h" | #include "util.h" | ||||
#include "utilstrencodings.h" | #include "utilstrencodings.h" | ||||
#include "validation.h" | #include "validation.h" | ||||
#include "warnings.h" | |||||
#include <boost/thread/thread.hpp> // boost::thread::interrupt | #include <boost/thread/thread.hpp> // boost::thread::interrupt | ||||
#include <condition_variable> | #include <condition_variable> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <mutex> | #include <mutex> | ||||
struct CUpdatedBlock { | struct CUpdatedBlock { | ||||
▲ Show 20 Lines • Show All 1,225 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
" \"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" | ||||
" \"warnings\" : \"...\", (string) any network and " | |||||
"blockchain warnings.\n" | |||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getblockchaininfo", "") + | HelpExampleCli("getblockchaininfo", "") + | ||||
HelpExampleRpc("getblockchaininfo", "")); | HelpExampleRpc("getblockchaininfo", "")); | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
Show All 23 Lines | UniValue getblockchaininfo(const Config &config, | ||||
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.pushKV("pruneheight", block->nHeight); | obj.pushKV("pruneheight", block->nHeight); | ||||
} | } | ||||
obj.pushKV("warnings", GetWarnings("statusbar")); | |||||
return obj; | return obj; | ||||
} | } | ||||
/** Comparison function for sorting the getchaintips heads. */ | /** Comparison function for sorting the getchaintips heads. */ | ||||
struct CompareBlocksByHeight { | struct CompareBlocksByHeight { | ||||
bool operator()(const CBlockIndex *a, const CBlockIndex *b) const { | bool operator()(const CBlockIndex *a, const CBlockIndex *b) const { | ||||
// Make sure that unequal blocks with the same height do not compare | // Make sure that unequal blocks with the same height do not compare | ||||
// equal. Use the pointers themselves to make a distinction. | // equal. Use the pointers themselves to make a distinction. | ||||
▲ Show 20 Lines • Show All 546 Lines • Show Last 20 Lines |