Bitcoin ABC
0.22.12
P2P Digital Currency
src
rpc
blockchain.h
Go to the documentation of this file.
1
// Copyright (c) 2017-2019 The Bitcoin developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_RPC_BLOCKCHAIN_H
6
#define BITCOIN_RPC_BLOCKCHAIN_H
7
8
#include <
sync.h
>
9
10
#include <
univalue.h
>
11
12
class
CBlock
;
13
class
CBlockIndex
;
14
class
ChainstateManager
;
15
class
Config
;
16
class
CTxMemPool
;
17
class
JSONRPCRequest
;
18
struct
NodeContext
;
19
namespace
util
{
20
class
Ref;
21
}
// namespace util
22
23
extern
RecursiveMutex
cs_main
;
24
25
UniValue
getblockchaininfo
(
const
Config
&config,
const
JSONRPCRequest
&request);
26
33
double
GetDifficulty
(
const
CBlockIndex
*blockindex);
34
36
void
RPCNotifyBlockChange
(
const
CBlockIndex
*pindex);
37
39
UniValue
blockToJSON
(
const
CBlock
&block,
const
CBlockIndex
*tip,
40
const
CBlockIndex
*blockindex,
bool
txDetails =
false
)
41
LOCKS_EXCLUDED
(cs_main);
42
44
UniValue
MempoolInfoToJSON
(const
CTxMemPool
&pool);
45
47
UniValue
MempoolToJSON
(const
CTxMemPool
&pool,
bool
verbose = false);
48
50
UniValue
blockheaderToJSON
(const
CBlockIndex
*tip,
51
const
CBlockIndex
*blockindex)
52
LOCKS_EXCLUDED
(cs_main);
53
54
NodeContext
&
EnsureNodeContext
(const
util
::Ref &context);
55
CTxMemPool
&
EnsureMemPool
(const
util
::Ref &context);
56
ChainstateManager
&
EnsureChainman
(const
util
::Ref &context);
57
58
#endif // BITCOIN_RPC_BLOCKCHAIN_H
util
Definition:
httprpc.h:13
MempoolInfoToJSON
UniValue MempoolInfoToJSON(const CTxMemPool &pool)
Mempool information to JSON.
Definition:
blockchain.cpp:1712
CBlock
Definition:
block.h:62
EnsureChainman
ChainstateManager & EnsureChainman(const util::Ref &context)
Definition:
blockchain.cpp:71
ChainstateManager
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition:
validation.h:1023
UniValue
Definition:
univalue.h:23
GetDifficulty
double GetDifficulty(const CBlockIndex *blockindex)
Get the required difficulty of the next block w/r/t the given block index.
Definition:
blockchain.cpp:82
blockheaderToJSON
UniValue blockheaderToJSON(const CBlockIndex *tip, const CBlockIndex *blockindex) LOCKS_EXCLUDED(cs_main)
Block header to JSON.
Definition:
blockchain.cpp:111
Config
Definition:
config.h:19
NodeContext
NodeContext struct containing references to chain state and connection state.
Definition:
context.h:35
MempoolToJSON
UniValue MempoolToJSON(const CTxMemPool &pool, bool verbose=false)
Mempool to JSON.
Definition:
blockchain.cpp:577
univalue.h
EnsureMemPool
CTxMemPool & EnsureMemPool(const util::Ref &context)
Definition:
blockchain.cpp:62
getblockchaininfo
UniValue getblockchaininfo(const Config &config, const JSONRPCRequest &request)
Definition:
blockchain.cpp:1415
EnsureNodeContext
NodeContext & EnsureNodeContext(const util::Ref &context)
Definition:
blockchain.cpp:55
cs_main
RecursiveMutex cs_main
Global state.
Definition:
validation.cpp:95
CTxMemPool
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition:
txmempool.h:468
AnnotatedMixin< std::recursive_mutex >
LOCKS_EXCLUDED
#define LOCKS_EXCLUDED(...)
Definition:
threadsafety.h:55
CBlockIndex
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition:
blockindex.h:23
blockToJSON
UniValue blockToJSON(const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails=false) LOCKS_EXCLUDED(cs_main)
Block description to JSON.
Definition:
blockchain.cpp:145
RPCNotifyBlockChange
void RPCNotifyBlockChange(const CBlockIndex *pindex)
Callback for when block tip changed.
Definition:
blockchain.cpp:246
sync.h
JSONRPCRequest
Definition:
request.h:33
Generated on Wed Jan 20 2021 20:16:25 for Bitcoin ABC by
1.8.13