* Get the node context. * * @param[in] req The HTTP request, whose status code will be set if node * context is not found. * @returns Pointer to the node context or nullptr if not found. */
| 84 | * @returns Pointer to the node context or nullptr if not found. |
| 85 | */ |
| 86 | static NodeContext* GetNodeContext(const std::any& context, HTTPRequest* req) |
| 87 | { |
| 88 | auto node_context = util::AnyPtr<NodeContext>(context); |
| 89 | if (!node_context) { |
| 90 | RESTERR(req, HTTP_INTERNAL_SERVER_ERROR, STR_INTERNAL_BUG("Node context not found!")); |
| 91 | return nullptr; |
| 92 | } |
| 93 | return node_context; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Get the node context mempool. |