aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-05-30 09:15:50 +0100
committerfanquake <fanquake@gmail.com>2022-05-30 09:16:09 +0100
commite3b7f10b10662a7823a246ec753baa7873e0bbed (patch)
tree7408e8779458c5bc55d51e6dc1fef910bc7f47cd /src
parentb6ab45ae5c911632db157a3ff7eaed23967d79cf (diff)
parent20ff4991e548630d7bb5e491fa4d69ec49369872 (diff)
downloadbitcoin-e3b7f10b10662a7823a246ec753baa7873e0bbed.tar.xz
Merge bitcoin/bitcoin#25237: rpc: Capture UniValue by ref for rpcdoccheck
20ff4991e548630d7bb5e491fa4d69ec49369872 rpc: Capture potentially large UniValue by ref for rpcdoccheck (Martin Zumsande) Pull request description: Capturing it by reference instead of value should save us from making a copy of a potentially large object. Saw this while having a look at #25229 although I couldn't reproduce an actual leak, so this is not a fix for that issue. ACKs for top commit: MarcoFalke: review ACK 20ff4991e548630d7bb5e491fa4d69ec49369872 theStack: Code-review ACK 20ff4991e548630d7bb5e491fa4d69ec49369872 furszy: Code ACK 20ff4991 Tree-SHA512: faf7bb14e37f8324b93a39095b07693626329da47c4a1ac8929bf99385e2e0567008e959e7e8540bc7d454d08fa41cccd39f55253c9a839fa88362922058a93b
Diffstat (limited to 'src')
-rw-r--r--src/rpc/util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 2d5d4a4cb9..7517f64ea1 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -583,7 +583,7 @@ UniValue RPCHelpMan::HandleRequest(const JSONRPCRequest& request) const
}
const UniValue ret = m_fun(*this, request);
if (gArgs.GetBoolArg("-rpcdoccheck", DEFAULT_RPC_DOC_CHECK)) {
- CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [ret](const RPCResult& res) { return res.MatchesType(ret); }));
+ CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [&ret](const RPCResult& res) { return res.MatchesType(ret); }));
}
return ret;
}