MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetMemPool

Function GetMemPool

src/rest.cpp:109–117  ·  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

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

Callers 3

rest_mempool_infoFunction · 0.85
rest_mempool_contentsFunction · 0.85
rest_getutxosFunction · 0.85

Calls 2

RESTERRFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected