* Get the node context chainstatemanager. * * @param[in] req The HTTP request, whose status code will be set if node * context chainstatemanager is not found. * @returns Pointer to the chainstatemanager or nullptr if none found. */
| 118 | * @returns Pointer to the chainstatemanager or nullptr if none found. |
| 119 | */ |
| 120 | static ChainstateManager* GetChainman(const std::any& context, HTTPRequest* req) |
| 121 | { |
| 122 | auto node_context = util::AnyPtr<NodeContext>(context); |
| 123 | if (!node_context || !node_context->chainman) { |
| 124 | RESTERR(req, HTTP_INTERNAL_SERVER_ERROR, STR_INTERNAL_BUG("Chainman disabled or instance not found!")); |
| 125 | return nullptr; |
| 126 | } |
| 127 | return node_context->chainman.get(); |
| 128 | } |
| 129 | |
| 130 | RESTResponseFormat ParseDataFormat(std::string& param, const std::string& strReq) |
| 131 | { |
no test coverage detected