BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
blockchain.h
Go to the documentation of this file.
1 // Copyright (c) 2017-2018 The Bitcoin Core 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 <vector>
9 #include <stdint.h>
10 #include <amount.h>
11 
12 class CBlock;
13 class CBlockIndex;
14 class UniValue;
15 
16 static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
17 
24 double GetDifficulty(const CBlockIndex* blockindex);
25 
27 void RPCNotifyBlockChange(bool ibd, const CBlockIndex *);
28 
30 UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false);
31 
34 
36 UniValue mempoolToJSON(bool fVerbose = false);
37 
39 UniValue blockheaderToJSON(const CBlockIndex* blockindex);
40 
42 void CalculatePercentilesByWeight(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector<std::pair<CAmount, int64_t>>& scores, int64_t total_weight);
43 
44 #endif
Definition: block.h:74
void RPCNotifyBlockChange(bool ibd, const CBlockIndex *)
Callback for when block tip changed.
Definition: blockchain.cpp:198
UniValue mempoolInfoToJSON()
Mempool information to JSON.
double GetDifficulty(const CBlockIndex *blockindex)
Get the difficulty of the net wrt to the given block index.
Definition: blockchain.cpp:60
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
UniValue mempoolToJSON(bool fVerbose=false)
Mempool to JSON.
Definition: blockchain.cpp:451
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.
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
UniValue blockheaderToJSON(const CBlockIndex *blockindex)
Block header to JSON.
Definition: blockchain.cpp:88
UniValue blockToJSON(const CBlock &block, const CBlockIndex *blockindex, bool txDetails=false)
Block description to JSON.
Definition: blockchain.cpp:118