#include <rpc/blockchain.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <coins.h>
#include <common/args.h>
#include <config.h>
#include <consensus/amount.h>
#include <consensus/params.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <hash.h>
#include <index/blockfilterindex.h>
#include <index/coinstatsindex.h>
#include <logging/timer.h>
#include <net.h>
#include <net_processing.h>
#include <node/blockstorage.h>
#include <node/coinstats.h>
#include <node/context.h>
#include <node/utxo_snapshot.h>
#include <primitives/transaction.h>
#include <rpc/server.h>
#include <rpc/server_util.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <streams.h>
#include <txdb.h>
#include <txmempool.h>
#include <undo.h>
#include <util/check.h>
#include <util/fs.h>
#include <util/strencodings.h>
#include <util/translation.h>
#include <validation.h>
#include <validationinterface.h>
#include <warnings.h>
#include <condition_variable>
#include <cstdint>
#include <memory>
#include <mutex>
Go to the source code of this file.
|
static CUpdatedBlock latestblock | GUARDED_BY (cs_blockchange) |
|
double | GetDifficulty (const CBlockIndex *blockindex) |
| Calculate the difficulty for a given block index.
|
|
static int | ComputeNextBlockAndDepth (const CBlockIndex *tip, const CBlockIndex *blockindex, const CBlockIndex *&next) |
|
static const CBlockIndex * | ParseHashOrHeight (const UniValue ¶m, ChainstateManager &chainman) |
|
UniValue | blockheaderToJSON (const CBlockIndex *tip, const CBlockIndex *blockindex) |
| Block header to JSON.
|
|
UniValue | blockToJSON (BlockManager &blockman, const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails) |
| Block description to JSON.
|
|
static RPCHelpMan | getblockcount () |
|
static RPCHelpMan | getbestblockhash () |
|
void | RPCNotifyBlockChange (const CBlockIndex *pindex) |
| Callback for when block tip changed.
|
|
static RPCHelpMan | waitfornewblock () |
|
static RPCHelpMan | waitforblock () |
|
static RPCHelpMan | waitforblockheight () |
|
static RPCHelpMan | syncwithvalidationinterfacequeue () |
|
static RPCHelpMan | getdifficulty () |
|
static RPCHelpMan | getblockfrompeer () |
|
static RPCHelpMan | getblockhash () |
|
static RPCHelpMan | getblockheader () |
|
static CBlock | GetBlockChecked (BlockManager &blockman, const CBlockIndex *pblockindex) |
|
static CBlockUndo | GetUndoChecked (BlockManager &blockman, const CBlockIndex *pblockindex) |
|
static RPCHelpMan | getblock () |
|
static RPCHelpMan | pruneblockchain () |
|
static CoinStatsHashType | ParseHashType (const std::string &hash_type_input) |
|
static RPCHelpMan | gettxoutsetinfo () |
|
RPCHelpMan | gettxout () |
|
static RPCHelpMan | verifychain () |
|
RPCHelpMan | getblockchaininfo () |
|
static RPCHelpMan | getchaintips () |
|
static RPCHelpMan | preciousblock () |
|
static RPCHelpMan | invalidateblock () |
|
RPCHelpMan | parkblock () |
|
static RPCHelpMan | reconsiderblock () |
|
RPCHelpMan | unparkblock () |
|
static RPCHelpMan | getchaintxstats () |
|
template<typename T > |
static T | CalculateTruncatedMedian (std::vector< T > &scores) |
|
template<typename T > |
static bool | SetHasKeys (const std::set< T > &set) |
|
template<typename T , typename Tk , typename... Args> |
static bool | SetHasKeys (const std::set< T > &set, const Tk &key, const Args &...args) |
|
static RPCHelpMan | getblockstats () |
|
static RPCHelpMan | scantxoutset () |
|
static RPCHelpMan | getblockfilter () |
|
static RPCHelpMan | dumptxoutset () |
| Serialize the UTXO set to a file for loading elsewhere.
|
|
UniValue | CreateUTXOSnapshot (NodeContext &node, Chainstate &chainstate, AutoFile &afile, const fs::path &path, const fs::path &temppath) |
| Helper to create UTXO snapshots given a chainstate and a file handle.
|
|
void | RegisterBlockchainRPCCommands (CRPCTable &t) |
|
◆ blockheaderToJSON()
◆ blockToJSON()
◆ CalculateTruncatedMedian()
◆ ComputeNextBlockAndDepth()
◆ CreateUTXOSnapshot()
Helper to create UTXO snapshots given a chainstate and a file handle.
- Returns
- a UniValue map containing metadata about the snapshot.
Definition at line 2644 of file blockchain.cpp.
◆ dumptxoutset()
Serialize the UTXO set to a file for loading elsewhere.
- See also
- SnapshotMetadata
Definition at line 2585 of file blockchain.cpp.
◆ getbestblockhash()
◆ getblock()
◆ getblockchaininfo()
◆ GetBlockChecked()
◆ getblockcount()
◆ getblockfilter()
◆ getblockfrompeer()
◆ getblockhash()
◆ getblockheader()
◆ getblockstats()
◆ getchaintips()
Idea: The set of chain tips is the active chain tip, plus orphan blocks which do not have another orphan building off of them. Algorithm:
- Make one pass through BlockIndex(), picking out the orphan blocks, and also storing a set of the orphan block's pprev pointers.
- Iterate through the orphan blocks. If the block isn't pointed to by another orphan, it is a chain tip.
- Add the active chain tip
Definition at line 1402 of file blockchain.cpp.
◆ getchaintxstats()
◆ getdifficulty()
◆ GetDifficulty()
Calculate the difficulty for a given block index.
Get the required difficulty of the next block w/r/t the given block index.
Definition at line 70 of file blockchain.cpp.
◆ gettxout()
◆ gettxoutsetinfo()
◆ GetUndoChecked()
◆ GUARDED_BY()
◆ invalidateblock()
◆ parkblock()
◆ ParseHashOrHeight()
◆ ParseHashType()
static CoinStatsHashType ParseHashType |
( |
const std::string & |
hash_type_input | ) |
|
|
static |
◆ preciousblock()
◆ pruneblockchain()
◆ reconsiderblock()
◆ RegisterBlockchainRPCCommands()
◆ RPCNotifyBlockChange()
◆ scantxoutset()
◆ SetHasKeys() [1/2]
◆ SetHasKeys() [2/2]
◆ syncwithvalidationinterfacequeue()
◆ unparkblock()
◆ verifychain()
◆ waitforblock()
◆ waitforblockheight()
◆ waitfornewblock()
◆ cond_blockchange
◆ cs_blockchange
◆ g_scan_in_progress
◆ g_scan_progress
RAII object to prevent concurrency issue when scanning the txout set.
Definition at line 2233 of file blockchain.cpp.
◆ g_should_abort_scan
◆ PER_UTXO_OVERHEAD
Initial value:=
An outpoint - a combination of a transaction hash and an index n into its vout.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition at line 1927 of file blockchain.cpp.