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

Function GetNodeContext

src/rest.cpp:88–100  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

86 * @returns Pointer to the node context or nullptr if not found.
87 */
88static NodeContext* GetNodeContext(const std::any& context, HTTPRequest* req)
89{
90 auto node_context = util::AnyPtr<NodeContext>(context);
91 if (!node_context) {
92 RESTERR(req, HTTP_INTERNAL_SERVER_ERROR,
93 strprintf("%s:%d (%s)\n"
94 "Internal bug detected: Node context not found!\n"
95 "You may report this issue here: %s\n",
96 __FILE__, __LINE__, __func__, PACKAGE_BUGREPORT));
97 return nullptr;
98 }
99 return node_context;
100}
101
102/**
103 * Get the node context mempool.

Callers 1

rest_txFunction · 0.85

Calls 1

RESTERRFunction · 0.85

Tested by

no test coverage detected