mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-23 22:42:34 +02:00
Drop JSONRPCRequest constructors after #21366
This just makes an additional simplification after #21366 replaced util::Ref with std::any. It was originally suggested https://github.com/bitcoin/bitcoin/pull/21366#issuecomment-792044351 but delayed for a followup. It would have prevented usage bug https://github.com/bitcoin/bitcoin/pull/21572.
This commit is contained in:
@@ -317,7 +317,8 @@ static bool rest_chaininfo(const std::any& context, HTTPRequest* req, const std:
|
||||
|
||||
switch (rf) {
|
||||
case RetFormat::JSON: {
|
||||
JSONRPCRequest jsonRequest(context);
|
||||
JSONRPCRequest jsonRequest;
|
||||
jsonRequest.context = context;
|
||||
jsonRequest.params = UniValue(UniValue::VARR);
|
||||
UniValue chainInfoObject = getblockchaininfo().HandleRequest(jsonRequest);
|
||||
std::string strJSON = chainInfoObject.write() + "\n";
|
||||
@@ -687,7 +688,7 @@ static const struct {
|
||||
void StartREST(const std::any& context)
|
||||
{
|
||||
for (const auto& up : uri_prefixes) {
|
||||
auto handler = [&context, up](HTTPRequest* req, const std::string& prefix) { return up.handler(context, req, prefix); };
|
||||
auto handler = [context, up](HTTPRequest* req, const std::string& prefix) { return up.handler(context, req, prefix); };
|
||||
RegisterHTTPHandler(up.prefix, false, handler);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user