* 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. */
| 107 | * @returns Pointer to the mempool or nullptr if no mempool found. |
| 108 | */ |
| 109 | static 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. |
no test coverage detected