mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
With `queuedTx` owning the `CTransactionRef` shared ptrs, they (and the managed objects) are entirely allocated on the heap. In `DisconnectedBlockTransactions::DynamicMemoryUsage`, we account for the 2 pointers that make up the shared_ptr, but not for the managed object (CTransaction) or the control block. Prior to this commit, by calculating the `RecursiveDynamicUsage` on a `CTransaction` whenever modifying `cachedInnerUsage`, we account for the dynamic usage of the `CTransaction`, i.e. the `vins` and `vouts` vectors, but we do not account for the `CTransaction` object itself, nor for the `CTransactionRef` control block. This means prior to this commit, `DynamicMemoryUsage` underestimates dynamic memory usage by not including the `CTransaction` objects and the shared ptr control blocks. Fix this by calculating `RecursiveDynamicUsage` on the `CTransactionRef` instead of the `CTransaction` whenever modifying `cachedInnerUsage`. |
||
|---|---|---|
| .. | ||
| bitcoinkernel.cpp | ||
| blockmanager_opts.h | ||
| chain.cpp | ||
| chain.h | ||
| chainparams.cpp | ||
| chainparams.h | ||
| chainstatemanager_opts.h | ||
| checks.cpp | ||
| checks.h | ||
| coinstats.cpp | ||
| coinstats.h | ||
| context.cpp | ||
| context.h | ||
| cs_main.cpp | ||
| cs_main.h | ||
| disconnected_transactions.cpp | ||
| disconnected_transactions.h | ||
| mempool_entry.h | ||
| mempool_limits.h | ||
| mempool_options.h | ||
| mempool_persist.cpp | ||
| mempool_persist.h | ||
| mempool_removal_reason.cpp | ||
| mempool_removal_reason.h | ||
| messagestartchars.h | ||
| notifications_interface.h | ||
| validation_cache_sizes.h | ||