Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.h
// Copyright (c) 2017-2019 The Bitcoin developers | // Copyright (c) 2017-2019 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_RPC_BLOCKCHAIN_H | #ifndef BITCOIN_RPC_BLOCKCHAIN_H | ||||
#define BITCOIN_RPC_BLOCKCHAIN_H | #define BITCOIN_RPC_BLOCKCHAIN_H | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
class CBlock; | class CBlock; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class Config; | class Config; | ||||
class CTxMemPool; | class CTxMemPool; | ||||
class JSONRPCRequest; | class JSONRPCRequest; | ||||
struct NodeContext; | |||||
extern RecursiveMutex cs_main; | extern RecursiveMutex cs_main; | ||||
UniValue getblockchaininfo(const Config &config, const JSONRPCRequest &request); | UniValue getblockchaininfo(const Config &config, const JSONRPCRequest &request); | ||||
/** | /** | ||||
* Get the required difficulty of the next block w/r/t the given block index. | * Get the required difficulty of the next block w/r/t the given block index. | ||||
* | * | ||||
Show All 16 Lines | |||||
/** Mempool to JSON */ | /** Mempool to JSON */ | ||||
UniValue MempoolToJSON(const CTxMemPool &pool, bool verbose = false); | UniValue MempoolToJSON(const CTxMemPool &pool, bool verbose = false); | ||||
/** Block header to JSON */ | /** Block header to JSON */ | ||||
UniValue blockheaderToJSON(const CBlockIndex *tip, | UniValue blockheaderToJSON(const CBlockIndex *tip, | ||||
const CBlockIndex *blockindex) | const CBlockIndex *blockindex) | ||||
LOCKS_EXCLUDED(cs_main); | LOCKS_EXCLUDED(cs_main); | ||||
//! Pointer to node state that needs to be declared as a global to be accessible | |||||
//! RPC methods. Due to limitations of the RPC framework, there's currently no | |||||
//! direct way to pass in state to RPC methods without globals. | |||||
extern NodeContext *g_rpc_node; | |||||
#endif // BITCOIN_RPC_BLOCKCHAIN_H | #endif // BITCOIN_RPC_BLOCKCHAIN_H |