aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-08 09:07:57 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-04-08 09:08:03 +0200
commit6664211be2b664dd471d7aeea12fcf2859dba860 (patch)
treeb07a5b5c3d8f1398ad62f40cac79b9e7e562f225 /src/rest.cpp
parent2e9031f95d2bf8d0134103a10a8a2162975f1259 (diff)
parent9044522ef76f880760165d98fab024802ccfc062 (diff)
Merge #21574: Drop JSONRPCRequest constructors after #21366
9044522ef76f880760165d98fab024802ccfc062 Drop JSONRPCRequest constructors after #21366 (Russell Yanofsky) Pull request description: 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. ACKs for top commit: promag: ACK 9044522ef76f880760165d98fab024802ccfc062, fixed conflict in src/wallet/interfaces.cpp. Tree-SHA512: e909411b8f75013620b94e1a609296befb832fdcb574cd2e6689bfe3c636b03cd4ac1ccb2b32b532daf0f2131bb043464024966310fffc7e3cad77713d4bd0ef
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index aa97470ca7..71d258b077 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -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);
}
}