aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/disconnected_transactions.cpp
AgeCommit message (Collapse)Author
2023-10-19bugfix: correct DisconnectedBlockTransactions memory usagestickies-v
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`.
2023-10-18assume duplicate transactions are not added to `iters_by_txid`ismaelsadeeq
In `AddTransactionsToBlock` description comment we have the asuumption that callers will never pass multiple transactions with the same txid We are asserting to assume that does not happen.
2023-10-18move only: move implementation code to disconnected_transactions.cppismaelsadeeq