aboutsummaryrefslogtreecommitdiff
path: root/src/primitives/transaction.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-07-09 13:56:31 -0400
committerPieter Wuille <pieter.wuille@gmail.com>2015-07-10 10:49:31 -0400
commit5098c47b2430ded299c21620527ebd0544fe51e2 (patch)
tree5423630dea9653802744ed2bb997797fc1b6ca96 /src/primitives/transaction.cpp
parent943b322d5d292707e193f3a9d8e971881540be23 (diff)
Implement accurate memory accounting for mempool
Diffstat (limited to 'src/primitives/transaction.cpp')
-rw-r--r--src/primitives/transaction.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp
index 606dbea798..7ed2d45973 100644
--- a/src/primitives/transaction.cpp
+++ b/src/primitives/transaction.cpp
@@ -72,6 +72,11 @@ void CTransaction::UpdateHash() const
*const_cast<uint256*>(&hash) = SerializeHash(*this);
}
+size_t CTransaction::DynamicMemoryUsage() const
+{
+ return memusage::RecursiveDynamicUsage(vin) + memusage::RecursiveDynamicUsage(vout);
+}
+
CTransaction::CTransaction() : nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0) { }
CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) {