@@ -202,7 +202,7 @@ static RPCHelpMan testmempoolaccept()
202202 auto it = package_result.m_tx_results .find (tx->GetWitnessHash ());
203203 if (exit_early || it == package_result.m_tx_results .end ()) {
204204 // Validation unfinished. Just return the txid and wtxid.
205- rpc_result.push_back (result_inner);
205+ rpc_result.push_back (std::move ( result_inner) );
206206 continue ;
207207 }
208208 const auto & tx_result = it->second ;
@@ -229,8 +229,8 @@ static RPCHelpMan testmempoolaccept()
229229 for (const auto & wtxid : tx_result.m_wtxids_fee_calculations .value ()) {
230230 effective_includes_res.push_back (wtxid.ToString ());
231231 }
232- fees.pushKV (" effective-includes" , effective_includes_res);
233- result_inner.pushKV (" fees" , fees);
232+ fees.pushKV (" effective-includes" , std::move ( effective_includes_res) );
233+ result_inner.pushKV (" fees" , std::move ( fees) );
234234 }
235235 } else {
236236 result_inner.pushKV (" allowed" , false );
@@ -241,7 +241,7 @@ static RPCHelpMan testmempoolaccept()
241241 result_inner.pushKV (" reject-reason" , state.GetRejectReason ());
242242 }
243243 }
244- rpc_result.push_back (result_inner);
244+ rpc_result.push_back (std::move ( result_inner) );
245245 }
246246 return rpc_result;
247247 },
@@ -295,7 +295,7 @@ static void entryToJSON(const CTxMemPool& pool, UniValue& info, const CTxMemPool
295295 fees.pushKV (" modified" , ValueFromAmount (e.GetModifiedFee ()));
296296 fees.pushKV (" ancestor" , ValueFromAmount (e.GetModFeesWithAncestors ()));
297297 fees.pushKV (" descendant" , ValueFromAmount (e.GetModFeesWithDescendants ()));
298- info.pushKV (" fees" , fees);
298+ info.pushKV (" fees" , std::move ( fees) );
299299
300300 const CTransaction& tx = e.GetTx ();
301301 std::set<std::string> setDepends;
@@ -311,14 +311,14 @@ static void entryToJSON(const CTxMemPool& pool, UniValue& info, const CTxMemPool
311311 depends.push_back (dep);
312312 }
313313
314- info.pushKV (" depends" , depends);
314+ info.pushKV (" depends" , std::move ( depends) );
315315
316316 UniValue spent (UniValue::VARR);
317317 for (const CTxMemPoolEntry& child : e.GetMemPoolChildrenConst ()) {
318318 spent.push_back (child.GetTx ().GetHash ().ToString ());
319319 }
320320
321- info.pushKV (" spentby" , spent);
321+ info.pushKV (" spentby" , std::move ( spent) );
322322
323323 // Add opt-in RBF status
324324 bool rbfStatus = false ;
@@ -347,7 +347,7 @@ UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose, bool include_mempoo
347347 // Mempool has unique entries so there is no advantage in using
348348 // UniValue::pushKV, which checks if the key already exists in O(N).
349349 // UniValue::pushKVEnd is used instead which currently is O(1).
350- o.pushKVEnd (e.GetTx ().GetHash ().ToString (), info);
350+ o.pushKVEnd (e.GetTx ().GetHash ().ToString (), std::move ( info) );
351351 }
352352 return o;
353353 } else {
@@ -364,7 +364,7 @@ UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose, bool include_mempoo
364364 return a;
365365 } else {
366366 UniValue o (UniValue::VOBJ);
367- o.pushKV (" txids" , a );
367+ o.pushKV (" txids" , std::move (a) );
368368 o.pushKV (" mempool_sequence" , mempool_sequence);
369369 return o;
370370 }
@@ -474,7 +474,7 @@ static RPCHelpMan getmempoolancestors()
474474 const uint256& _hash = e.GetTx ().GetHash ();
475475 UniValue info (UniValue::VOBJ);
476476 entryToJSON (mempool, info, e);
477- o.pushKV (_hash.ToString (), info);
477+ o.pushKV (_hash.ToString (), std::move ( info) );
478478 }
479479 return o;
480480 }
@@ -539,7 +539,7 @@ static RPCHelpMan getmempooldescendants()
539539 const uint256& _hash = e.GetTx ().GetHash ();
540540 UniValue info (UniValue::VOBJ);
541541 entryToJSON (mempool, info, e);
542- o.pushKV (_hash.ToString (), info);
542+ o.pushKV (_hash.ToString (), std::move ( info) );
543543 }
544544 return o;
545545 }
@@ -653,7 +653,7 @@ static RPCHelpMan gettxspendingprevout()
653653 o.pushKV (" spendingtxid" , spendingTx->GetHash ().ToString ());
654654 }
655655
656- result.push_back (o );
656+ result.push_back (std::move (o) );
657657 }
658658
659659 return result;
@@ -992,20 +992,20 @@ static RPCHelpMan submitpackage()
992992 for (const auto & wtxid : tx_result.m_wtxids_fee_calculations .value ()) {
993993 effective_includes_res.push_back (wtxid.ToString ());
994994 }
995- fees.pushKV (" effective-includes" , effective_includes_res);
995+ fees.pushKV (" effective-includes" , std::move ( effective_includes_res) );
996996 }
997- result_inner.pushKV (" fees" , fees);
997+ result_inner.pushKV (" fees" , std::move ( fees) );
998998 for (const auto & ptx : it->second .m_replaced_transactions ) {
999999 replaced_txids.insert (ptx->GetHash ());
10001000 }
10011001 break ;
10021002 }
1003- tx_result_map.pushKV (tx->GetWitnessHash ().GetHex (), result_inner);
1003+ tx_result_map.pushKV (tx->GetWitnessHash ().GetHex (), std::move ( result_inner) );
10041004 }
1005- rpc_result.pushKV (" tx-results" , tx_result_map);
1005+ rpc_result.pushKV (" tx-results" , std::move ( tx_result_map) );
10061006 UniValue replaced_list (UniValue::VARR);
10071007 for (const uint256& hash : replaced_txids) replaced_list.push_back (hash.ToString ());
1008- rpc_result.pushKV (" replaced-transactions" , replaced_list);
1008+ rpc_result.pushKV (" replaced-transactions" , std::move ( replaced_list) );
10091009 return rpc_result;
10101010 },
10111011 };
0 commit comments