aboutsummaryrefslogtreecommitdiff
path: root/src/primitives
diff options
context:
space:
mode:
Diffstat (limited to 'src/primitives')
-rw-r--r--src/primitives/transaction.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h
index 0ba9affeda..6cfd93a9a1 100644
--- a/src/primitives/transaction.h
+++ b/src/primitives/transaction.h
@@ -135,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.
@@ -146,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)