Skip to content

Commit 310ba92

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24537: rpc: Split mempool RPCs from blockchain.cpp
fad4c89 Add RegisterMempoolRPCCommands helper (MarcoFalke) fafd40b refactor: Avoid int64_t -> size_t -> int64_t conversion (MarcoFalke) fa2a5f3 rpc: Move mempool RPCs to new file (MarcoFalke) Pull request description: The `blockchain.cpp` file is quite large. This makes it harder to navigate and increases the memory required to compile. Improve on both issues by splitting up the mempool RPCs to a separate file. ACKs for top commit: promag: Code review ACK fad4c89. theStack: Code-review ACK fad4c89 🏞️ Tree-SHA512: 7f13168ea2cbea51eaef05ca1604fddc919480a2128ec7fa6b1f9365ec5e4822c3df93eb408a19f038c627f2309fa282b9f7f7ec45e5e661fc728f6b33157f89
2 parents 7606512 + fad4c89 commit 310ba92

File tree

8 files changed

+502
-463
lines changed

8 files changed

+502
-463
lines changed

src/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ BITCOIN_CORE_H = \
209209
reverse_iterator.h \
210210
rpc/blockchain.h \
211211
rpc/client.h \
212+
rpc/mempool.h \
212213
rpc/mining.h \
213214
rpc/protocol.h \
214215
rpc/rawtransaction_util.h \
@@ -370,6 +371,7 @@ libbitcoin_node_a_SOURCES = \
370371
pow.cpp \
371372
rest.cpp \
372373
rpc/blockchain.cpp \
374+
rpc/mempool.cpp \
373375
rpc/mining.cpp \
374376
rpc/misc.cpp \
375377
rpc/net.cpp \

src/bench/rpc_mempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <bench/bench.h>
6-
#include <rpc/blockchain.h>
6+
#include <rpc/mempool.h>
77
#include <txmempool.h>
88

99
#include <univalue.h>

src/rest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <primitives/block.h>
1616
#include <primitives/transaction.h>
1717
#include <rpc/blockchain.h>
18+
#include <rpc/mempool.h>
1819
#include <rpc/protocol.h>
1920
#include <rpc/server.h>
2021
#include <rpc/server_util.h>

src/rpc/blockchain.cpp

Lines changed: 2 additions & 455 deletions
Large diffs are not rendered by default.

src/rpc/blockchain.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ extern RecursiveMutex cs_main;
2020
class CBlock;
2121
class CBlockIndex;
2222
class CChainState;
23-
class CTxMemPool;
2423
class UniValue;
2524
namespace node {
2625
struct NodeContext;
@@ -42,12 +41,6 @@ void RPCNotifyBlockChange(const CBlockIndex*);
4241
/** Block description to JSON */
4342
UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIndex* blockindex, TxVerbosity verbosity) LOCKS_EXCLUDED(cs_main);
4443

45-
/** Mempool information to JSON */
46-
UniValue MempoolInfoToJSON(const CTxMemPool& pool);
47-
48-
/** Mempool to JSON */
49-
UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose = false, bool include_mempool_sequence = false);
50-
5144
/** Block header to JSON */
5245
UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex) LOCKS_EXCLUDED(cs_main);
5346

0 commit comments

Comments
 (0)