diff options
Diffstat (limited to 'src/primitives')
-rw-r--r-- | src/primitives/transaction.cpp | 5 | ||||
-rw-r--r-- | src/primitives/transaction.h | 16 |
2 files changed, 5 insertions, 16 deletions
diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 7ed2d45973..606dbea798 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -72,11 +72,6 @@ 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) { diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 77326c64b0..2a457cdae7 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -7,7 +7,6 @@ #define BITCOIN_PRIMITIVES_TRANSACTION_H #include "amount.h" -#include "memusage.h" #include "script/script.h" #include "serialize.h" #include "uint256.h" @@ -49,8 +48,6 @@ public: } std::string ToString() const; - - size_t DynamicMemoryUsage() const { return 0; } }; /** An input of a transaction. It contains the location of the previous @@ -99,8 +96,6 @@ public: } std::string ToString() const; - - size_t DynamicMemoryUsage() const { return scriptSig.DynamicMemoryUsage(); } }; /** An output of a transaction. It contains the public key that the next input @@ -146,10 +141,13 @@ public: // which has units satoshis-per-kilobyte. // If you'd pay more than 1/3 in fees // to spend something, then we consider it dust. - // A typical txout is 34 bytes big, and will + // A typical spendable txout is 34 bytes big, and will // need a CTxIn of at least 148 bytes to spend: - // so dust is a txout less than 546 satoshis + // so dust is a spendable txout less than 546 satoshis // with default minRelayTxFee. + if (scriptPubKey.IsUnspendable()) + return 0; + size_t nSize = GetSerializeSize(SER_DISK,0)+148u; return 3*minRelayTxFee.GetFee(nSize); } @@ -171,8 +169,6 @@ public: } std::string ToString() const; - - size_t DynamicMemoryUsage() const { return scriptPubKey.DynamicMemoryUsage(); } }; struct CMutableTransaction; @@ -256,8 +252,6 @@ public: } std::string ToString() const; - - size_t DynamicMemoryUsage() const; }; /** A mutable version of CTransaction. */ |