MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetMemPool

Function GetMemPool

src/rest.cpp:103–111  ·  view source on GitHub ↗

* Get the node context mempool. * * @param[in] req The HTTP request, whose status code will be set if node * context mempool is not found. * @returns Pointer to the mempool or nullptr if no mempool found. */

Source from the content-addressed store, hash-verified

101 * @returns Pointer to the mempool or nullptr if no mempool found.
102 */
103static CTxMemPool* GetMemPool(const std::any& context, HTTPRequest* req)
104{
105 auto node_context = util::AnyPtr<NodeContext>(context);
106 if (!node_context || !node_context->mempool) {
107 RESTERR(req, HTTP_NOT_FOUND, "Mempool disabled or instance not found");
108 return nullptr;
109 }
110 return node_context->mempool.get();
111}
112
113/**
114 * Get the node context chainstatemanager.

Callers 2

rest_mempoolFunction · 0.85
rest_getutxosFunction · 0.85

Calls 2

RESTERRFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected