mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Merge bitcoin/bitcoin#30094: rpc: move UniValue in blockToJSON
b77bad309erpc: move UniValue in blockToJSON (willcl-ark) Pull request description: Fixes: #24542 Fixes: #30052 Without explicitly declaring the move, these `UniValues` get copied, causing increased memory usage. Fix this by explicitly moving the `UniValue` objects. Used by `rest_block` and `getblock` RPC. ACKs for top commit: maflcko: review ACKb77bad309eismaelsadeeq: ACKb77bad309eTheCharlatan: ACKb77bad309etheuni: utACKb77bad309ehebasto: ACKb77bad309e, I have reviewed the code and it looks OK. BrandonOdiwuor: ACKb77bad309eTree-SHA512: 767608331040f9cfe5c3568ed0e3c338920633472a1a50d4bbb47d1dc69d2bb11466d611f050ac8ad1a894b47fe1ea4d968cf34cbd44d4bb8d479fc5c7475f6d
This commit is contained in:
parent
b8aa7eba90
commit
203ee5d7fe
1 changed files with 2 additions and 2 deletions
|
|
@ -279,12 +279,12 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIn
|
|||
const CTxUndo* txundo = (have_undo && i > 0) ? &blockUndo.vtxundo.at(i - 1) : nullptr;
|
||||
UniValue objTx(UniValue::VOBJ);
|
||||
TxToUniv(*tx, uint256(), objTx, true, RPCSerializationFlags(), txundo, verbosity);
|
||||
txs.push_back(objTx);
|
||||
txs.push_back(std::move(objTx));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
result.pushKV("tx", txs);
|
||||
result.pushKV("tx", std::move(txs));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue