File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 9
9
#include " primitives/transaction.h"
10
10
#include " validation.h"
11
11
#include " httpserver.h"
12
+ #include " rpc/blockchain.h"
12
13
#include " rpc/server.h"
13
14
#include " streams.h"
14
15
#include " sync.h"
@@ -55,12 +56,9 @@ struct CCoin {
55
56
}
56
57
};
57
58
58
- extern void TxToJSON (const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
59
- extern UniValue blockToJSON (const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false );
60
- extern UniValue mempoolInfoToJSON ();
61
- extern UniValue mempoolToJSON (bool fVerbose = false );
62
- extern void ScriptPubKeyToJSON (const CScript& scriptPubKey, UniValue& out, bool fIncludeHex );
63
- extern UniValue blockheaderToJSON (const CBlockIndex* blockindex);
59
+ /* Defined in rawtransaction.cpp */
60
+ void TxToJSON (const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
61
+ void ScriptPubKeyToJSON (const CScript& scriptPubKey, UniValue& out, bool fIncludeHex );
64
62
65
63
static bool RESTERR (HTTPRequest* req, enum HTTPStatusCode status, std::string message)
66
64
{
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
101
101
return result;
102
102
}
103
103
104
- UniValue blockToJSON (const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false )
104
+ UniValue blockToJSON (const CBlock& block, const CBlockIndex* blockindex, bool txDetails)
105
105
{
106
106
UniValue result (UniValue::VOBJ);
107
107
result.push_back (Pair (" hash" , blockindex->GetBlockHash ().GetHex ()));
@@ -378,7 +378,7 @@ void entryToJSON(UniValue &info, const CTxMemPoolEntry &e)
378
378
info.push_back (Pair (" depends" , depends));
379
379
}
380
380
381
- UniValue mempoolToJSON (bool fVerbose = false )
381
+ UniValue mempoolToJSON (bool fVerbose )
382
382
{
383
383
if (fVerbose )
384
384
{
Original file line number Diff line number Diff line change 5
5
#ifndef BITCOIN_RPC_BLOCKCHAIN_H
6
6
#define BITCOIN_RPC_BLOCKCHAIN_H
7
7
8
+ class CBlock ;
8
9
class CBlockIndex ;
10
+ class CScript ;
11
+ class CTransaction ;
12
+ class uint256 ;
13
+ class UniValue ;
9
14
10
15
/* *
11
16
* Get the difficulty of the net wrt to the given block index, or the chain tip if
@@ -19,5 +24,17 @@ double GetDifficulty(const CBlockIndex* blockindex = nullptr);
19
24
/* * Callback for when block tip changed. */
20
25
void RPCNotifyBlockChange (bool ibd, const CBlockIndex *);
21
26
27
+ /* * Block description to JSON */
28
+ UniValue blockToJSON (const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false );
29
+
30
+ /* * Mempool information to JSON */
31
+ UniValue mempoolInfoToJSON ();
32
+
33
+ /* * Mempool to JSON */
34
+ UniValue mempoolToJSON (bool fVerbose = false );
35
+
36
+ /* * Block header to JSON */
37
+ UniValue blockheaderToJSON (const CBlockIndex* blockindex);
38
+
22
39
#endif
23
40
You can’t perform that action at this time.
0 commit comments