diff options
author | fanquake <fanquake@gmail.com> | 2022-07-13 15:52:10 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-07-13 15:58:53 +0100 |
commit | 081965ccc3f516ffbccf912149b901aab67daa9d (patch) | |
tree | 7a72843b3e672c391b1bafcc2932e70a054776b4 /src/init.cpp | |
parent | 1d89fc695a3aeb3e3dcadf371b7667572b38c836 (diff) | |
parent | fa8a1c06961f4b1826696e0db8dce81dce627721 (diff) | |
download | bitcoin-081965ccc3f516ffbccf912149b901aab67daa9d.tar.xz |
Merge bitcoin/bitcoin#25464: rpc: Reduce Univalue push_backV peak memory usage in listtransactions
fa8a1c06961f4b1826696e0db8dce81dce627721 rpc: Fix Univalue push_backV OOM in listtransactions (MacroFake)
Pull request description:
Related to, but not intended as a fix for #25229.
Currently the RPC will have the same data stored thrice:
* `UniValue ret` (memory filled by `ListTransactions`)
* `std::vector<UniValue> vec` (constructed by calling `push_backV`)
* `UniValue result` (the actual result, memory filled by `push_backV`)
Fix this by filling the memory only once:
* `std::vector<UniValue> ret` (memory filled by `ListTransactions`)
* Pass iterators to `push_backV` instead of creating a full copy
* Move memory into `UniValue result` instead of copying it
ACKs for top commit:
shaavan:
Code Review ACK fa8a1c06961f4b1826696e0db8dce81dce627721
Tree-SHA512: 1c3ca40fc8497134a4141195160e4aa9fe72b3c00c5998c972b58ad0eb498ebea05013f9105bb80e7264c9db1d0e7a2032396a8a4af1f326d831fbee20f32ea3
Diffstat (limited to 'src/init.cpp')
0 files changed, 0 insertions, 0 deletions