Bitcoin Core 28.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
blockchain.h File Reference
#include <consensus/amount.h>
#include <core_io.h>
#include <streams.h>
#include <sync.h>
#include <util/fs.h>
#include <validation.h>
#include <any>
#include <stdint.h>
#include <vector>
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

namespace  node
 

Functions

double GetDifficulty (const CBlockIndex &blockindex)
 Get the difficulty of the net wrt to the given block index.
 
void RPCNotifyBlockChange (const CBlockIndex *)
 Callback for when block tip changed.
 
UniValue blockToJSON (node::BlockManager &blockman, const CBlock &block, const CBlockIndex &tip, const CBlockIndex &blockindex, TxVerbosity verbosity) LOCKS_EXCLUDED(cs_main)
 Block description to JSON.
 
UniValue blockheaderToJSON (const CBlockIndex &tip, const CBlockIndex &blockindex) LOCKS_EXCLUDED(cs_main)
 Block header to JSON.
 
void CalculatePercentilesByWeight (CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector< std::pair< CAmount, int64_t > > &scores, int64_t total_weight)
 Used by getblockstats to get feerates at different percentiles by weight

 
UniValue CreateUTXOSnapshot (node::NodeContext &node, Chainstate &chainstate, AutoFile &afile, const fs::path &path, const fs::path &tmppath)
 Helper to create UTXO snapshots given a chainstate and a file handle.
 

Variables

static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5
 

Function Documentation

◆ blockheaderToJSON()

UniValue blockheaderToJSON ( const CBlockIndex & tip,
const CBlockIndex & blockindex )

Block header to JSON.

Definition at line 138 of file blockchain.cpp.

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

◆ blockToJSON()

UniValue blockToJSON ( node::BlockManager & blockman,
const CBlock & block,
const CBlockIndex & tip,
const CBlockIndex & blockindex,
TxVerbosity verbosity )

Block description to JSON.

Definition at line 167 of file blockchain.cpp.

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

◆ CalculatePercentilesByWeight()

void CalculatePercentilesByWeight ( CAmount result[NUM_GETBLOCKSTATS_PERCENTILES],
std::vector< std::pair< CAmount, int64_t > > & scores,
int64_t total_weight )

Used by getblockstats to get feerates at different percentiles by weight

Definition at line 1767 of file blockchain.cpp.

Here is the caller graph for this function:

◆ CreateUTXOSnapshot()

UniValue CreateUTXOSnapshot ( node::NodeContext & node,
Chainstate & chainstate,
AutoFile & afile,
const fs::path & path,
const fs::path & tmppath )

Helper to create UTXO snapshots given a chainstate and a file handle.

Returns
a UniValue map containing metadata about the snapshot.

Definition at line 2704 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 difficulty of the net wrt to the given block index.

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

Definition at line 80 of file blockchain.cpp.

Here is the caller graph for this function:

◆ RPCNotifyBlockChange()

void RPCNotifyBlockChange ( const CBlockIndex * pindex)

Callback for when block tip changed.

Definition at line 246 of file blockchain.cpp.

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

Variable Documentation

◆ NUM_GETBLOCKSTATS_PERCENTILES

int NUM_GETBLOCKSTATS_PERCENTILES = 5
staticconstexpr

Definition at line 28 of file blockchain.h.