#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. More...
|
|
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. More...
|
|
UniValue | blockToJSON (BlockManager &blockman, const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails) |
| Block description to JSON. More...
|
|
static RPCHelpMan | getblockcount () |
|
static RPCHelpMan | getbestblockhash () |
|
void | RPCNotifyBlockChange (const CBlockIndex *pindex) |
| Callback for when block tip changed. More...
|
|
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. More...
|
|
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. More...
|
|
void | RegisterBlockchainRPCCommands (CRPCTable &t) |
|
◆ blockheaderToJSON()
◆ blockToJSON()
◆ CalculateTruncatedMedian()
template<typename T >
static T CalculateTruncatedMedian |
( |
std::vector< T > & |
scores | ) |
|
|
static |
◆ 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()
void RegisterBlockchainRPCCommands |
( |
CRPCTable & |
t | ) |
|
◆ RPCNotifyBlockChange()
void RPCNotifyBlockChange |
( |
const CBlockIndex * |
pindex | ) |
|
◆ scantxoutset()
◆ SetHasKeys() [1/2]
template<typename T >
static bool SetHasKeys |
( |
const std::set< T > & |
set | ) |
|
|
inlinestatic |
◆ SetHasKeys() [2/2]
template<typename T , typename Tk , typename... Args>
static bool SetHasKeys |
( |
const std::set< T > & |
set, |
|
|
const Tk & |
key, |
|
|
const Args &... |
args |
|
) |
| |
|
inlinestatic |
◆ syncwithvalidationinterfacequeue()
static RPCHelpMan syncwithvalidationinterfacequeue |
( |
| ) |
|
|
static |
◆ unparkblock()
◆ verifychain()
◆ waitforblock()
◆ waitforblockheight()
◆ waitfornewblock()
◆ cond_blockchange
std::condition_variable cond_blockchange |
|
static |
◆ cs_blockchange
◆ g_scan_in_progress
std::atomic<bool> g_scan_in_progress |
|
static |
◆ g_scan_progress
std::atomic<int> g_scan_progress |
|
static |
RAII object to prevent concurrency issue when scanning the txout set.
Definition at line 2233 of file blockchain.cpp.
◆ g_should_abort_scan
std::atomic<bool> g_should_abort_scan |
|
static |
◆ PER_UTXO_OVERHEAD
constexpr size_t PER_UTXO_OVERHEAD |
|
staticconstexpr |
Initial value:=
sizeof(COutPoint) + sizeof(uint32_t) + sizeof(bool)
Definition at line 1927 of file blockchain.cpp.