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

Function GetChainman

src/rest.cpp:120–128  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

118 * @returns Pointer to the chainstatemanager or nullptr if none found.
119 */
120static 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
130RESTResponseFormat ParseDataFormat(std::string& param, const std::string& strReq)
131{

Callers 8

rest_headersFunction · 0.85
rest_spent_txoutsFunction · 0.85
rest_blockFunction · 0.85
rest_filter_headerFunction · 0.85
rest_block_filterFunction · 0.85
rest_deploymentinfoFunction · 0.85
rest_getutxosFunction · 0.85
rest_blockhash_by_heightFunction · 0.85

Calls 2

RESTERRFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected