Bitcoin ABC  0.24.7
P2P Digital Currency
Namespaces | Functions | Variables
blockchain.h File Reference
#include <sync.h>
#include <univalue.h>
Include dependency graph for blockchain.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 util
 

Functions

RPCHelpMan getblockchaininfo ()
 
double GetDifficulty (const CBlockIndex *blockindex)
 Get the required difficulty of the next block w/r/t the given block index. More...
 
void RPCNotifyBlockChange (const CBlockIndex *pindex)
 Callback for when block tip changed. More...
 
UniValue blockToJSON (const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails=false) LOCKS_EXCLUDED(cs_main)
 Block description to JSON. More...
 
UniValue MempoolInfoToJSON (const CTxMemPool &pool)
 Mempool information to JSON. More...
 
UniValue MempoolToJSON (const CTxMemPool &pool, bool verbose=false, bool include_mempool_sequence=false)
 Mempool to JSON. More...
 
UniValue blockheaderToJSON (const CBlockIndex *tip, const CBlockIndex *blockindex) LOCKS_EXCLUDED(cs_main)
 Block header to JSON. More...
 
NodeContextEnsureNodeContext (const util::Ref &context)
 
CTxMemPoolEnsureMemPool (const util::Ref &context)
 
ChainstateManagerEnsureChainman (const util::Ref &context)
 

Variables

RecursiveMutex cs_main
 Global state. More...
 

Function Documentation

◆ blockheaderToJSON()

UniValue blockheaderToJSON ( const CBlockIndex tip,
const CBlockIndex blockindex 
)

Block header to JSON.

Definition at line 112 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blockToJSON()

UniValue blockToJSON ( const CBlock block,
const CBlockIndex tip,
const CBlockIndex blockindex,
bool  txDetails = false 
)

Block description to JSON.

Definition at line 146 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnsureChainman()

ChainstateManager& EnsureChainman ( const util::Ref context)

Definition at line 72 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnsureMemPool()

CTxMemPool& EnsureMemPool ( const util::Ref context)

Definition at line 63 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnsureNodeContext()

NodeContext& EnsureNodeContext ( const util::Ref context)

Definition at line 56 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getblockchaininfo()

RPCHelpMan getblockchaininfo ( )

Definition at line 1495 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDifficulty()

double GetDifficulty ( const CBlockIndex blockindex)

Get the required difficulty of the next block w/r/t the given block index.

Returns
A floating point number that is a multiple of the main net minimum difficulty (4295032833 hashes).

Get the required difficulty of the next block w/r/t the given block index.

Definition at line 83 of file blockchain.cpp.

Here is the caller graph for this function:

◆ MempoolInfoToJSON()

UniValue MempoolInfoToJSON ( const CTxMemPool pool)

Mempool information to JSON.

Definition at line 1800 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MempoolToJSON()

UniValue MempoolToJSON ( const CTxMemPool pool,
bool  verbose = false,
bool  include_mempool_sequence = false 
)

Mempool to JSON.

Definition at line 589 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RPCNotifyBlockChange()

void RPCNotifyBlockChange ( const CBlockIndex pindex)

Callback for when block tip changed.

Definition at line 247 of file blockchain.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ cs_main

RecursiveMutex cs_main

Global state.

Mutex to guard access to validation specific variables, such as reading or changing the chainstate.

This may also need to be locked when updating the transaction pool, e.g. on AcceptToMemoryPool. See CTxMemPool::cs comment for details.

The transaction pool has a separate lock to allow reading from it and the chainstate at the same time.

Definition at line 103 of file validation.cpp.