aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/daemon_handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/daemon_handler.cpp')
-rw-r--r--src/rpc/daemon_handler.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rpc/daemon_handler.cpp b/src/rpc/daemon_handler.cpp
index ab28319cb..248c54afb 100644
--- a/src/rpc/daemon_handler.cpp
+++ b/src/rpc/daemon_handler.cpp
@@ -182,7 +182,12 @@ namespace rpc
for (const auto& blob : it->second)
{
bwt.transactions.emplace_back();
- if (!parse_and_validate_tx_from_blob(blob.second, bwt.transactions.back()))
+ bwt.transactions.back().pruned = req.prune;
+
+ const bool parsed = req.prune ?
+ parse_and_validate_tx_base_from_blob(blob.second, bwt.transactions.back()) :
+ parse_and_validate_tx_from_blob(blob.second, bwt.transactions.back());
+ if (!parsed)
{
res.blocks.clear();
res.output_indices.clear();
@@ -905,13 +910,13 @@ namespace rpc
return true;
}
- epee::byte_slice DaemonHandler::handle(const std::string& request)
+ epee::byte_slice DaemonHandler::handle(std::string&& request)
{
MDEBUG("Handling RPC request: " << request);
try
{
- FullMessage req_full(request, true);
+ FullMessage req_full(std::move(request), true);
const std::string request_type = req_full.getRequestType();
const auto matched_handler = std::lower_bound(std::begin(handlers), std::end(handlers), request_type);