1 // Copyright (c) 2017 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.
5 #ifndef BITCOIN_RPC_BLOCKCHAIN_H
6 #define BITCOIN_RPC_BLOCKCHAIN_H
13 * Get the difficulty of the net wrt to the given block index, or the chain tip if
16 * @return A floating point number that is a multiple of the main net minimum
17 * difficulty (4295032833 hashes).
19 double GetDifficulty(const CBlockIndex
* blockindex
= nullptr);
21 /** Callback for when block tip changed. */
22 void RPCNotifyBlockChange(bool ibd
, const CBlockIndex
*);
24 /** Block description to JSON */
25 UniValue
blockToJSON(const CBlock
& block
, const CBlockIndex
* blockindex
, bool txDetails
= false);
27 /** Mempool information to JSON */
28 UniValue
mempoolInfoToJSON();
30 /** Mempool to JSON */
31 UniValue
mempoolToJSON(bool fVerbose
= false);
33 /** Block header to JSON */
34 UniValue
blockheaderToJSON(const CBlockIndex
* blockindex
);