From 83b8f3a8961baa34a136ecfaf62c3ea0d133b6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20G=C3=B6gge?= Date: Wed, 22 Dec 2021 20:46:47 +0100 Subject: [refactor] various style fix-ups --- src/rest.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/rest.cpp b/src/rest.cpp index 58b0de539a..65033c6c96 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -341,11 +341,10 @@ static bool rest_block_notxdetails(const std::any& context, HTTPRequest* req, co return rest_block(context, req, strURIPart, TxVerbosity::SHOW_TXID); } - static bool rest_filter_header(const std::any& context, HTTPRequest* req, const std::string& strURIPart) { - if (!CheckWarmup(req)) - return false; + if (!CheckWarmup(req)) return false; + std::string param; const RetFormat rf = ParseDataFormat(param, strURIPart); @@ -375,7 +374,7 @@ static bool rest_filter_header(const std::any& context, HTTPRequest* req, const return RESTERR(req, HTTP_BAD_REQUEST, strprintf("Header count out of acceptable range (1-%u): %s", MAX_REST_HEADERS_RESULTS, uri_parts[1])); } - std::vector headers; + std::vector headers; headers.reserve(*parsed_count); { ChainstateManager* maybe_chainman = GetChainman(context, req); @@ -396,7 +395,7 @@ static bool rest_filter_header(const std::any& context, HTTPRequest* req, const std::vector filter_headers; filter_headers.reserve(*parsed_count); - for (const CBlockIndex *pindex : headers) { + for (const CBlockIndex* pindex : headers) { uint256 filter_header; if (!index->LookupFilterHeader(pindex, filter_header)) { std::string errmsg = "Filter not found."; @@ -454,12 +453,12 @@ static bool rest_filter_header(const std::any& context, HTTPRequest* req, const static bool rest_block_filter(const std::any& context, HTTPRequest* req, const std::string& strURIPart) { - if (!CheckWarmup(req)) - return false; + if (!CheckWarmup(req)) return false; + std::string param; const RetFormat rf = ParseDataFormat(param, strURIPart); - //request is sent over URI scheme /rest/blockfilter/filtertype/blockhash + // request is sent over URI scheme /rest/blockfilter/filtertype/blockhash std::vector uri_parts; boost::split(uri_parts, param, boost::is_any_of("/")); if (uri_parts.size() != 2) { -- cgit v1.2.3