diff options
Diffstat (limited to 'src/primitives/transaction.h')
-rw-r--r-- | src/primitives/transaction.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 1b5a47e0da..6cfd93a9a1 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -25,7 +25,8 @@ public: template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(FLATDATA(*this)); + READWRITE(hash); + READWRITE(n); } void SetNull() { hash.SetNull(); n = (uint32_t) -1; } @@ -134,7 +135,7 @@ public: uint256 GetHash() const; - bool IsDust(CFeeRate minRelayTxFee) const + CAmount GetDustThreshold(const CFeeRate &minRelayTxFee) const { // "Dust" is defined in terms of CTransaction::minRelayTxFee, // which has units satoshis-per-kilobyte. @@ -145,7 +146,12 @@ public: // so dust is a txout less than 546 satoshis // with default minRelayTxFee. size_t nSize = GetSerializeSize(SER_DISK,0)+148u; - return (nValue < 3*minRelayTxFee.GetFee(nSize)); + return 3*minRelayTxFee.GetFee(nSize); + } + + bool IsDust(const CFeeRate &minRelayTxFee) const + { + return (nValue < GetDustThreshold(minRelayTxFee)); } friend bool operator==(const CTxOut& a, const CTxOut& b) |