aboutsummaryrefslogtreecommitdiff
path: root/src/primitives/transaction.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-03-16 12:22:52 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-03-16 12:23:14 +0100
commitdf5c246ba38c5b5bdd6192b0201d2fe8245451ca (patch)
treed03315ec086de900551c1e0413c537edabdff2c4 /src/primitives/transaction.h
parent41259ca6350cc9e27bd9a69bb7ab76af81262577 (diff)
parent1d9b378c3071293a31a3b4d1845d9626f10da432 (diff)
Merge pull request #5831
1d9b378 qa/rpc-tests/wallet: Tests for sendmany (Luke Dashjr) 40a7573 rpcwallet/sendmany: Just take an array of addresses to subtract fees from, rather than an Object with all values being identical (Luke Dashjr) 292623a Subtract fee from amount (Cozz Lovan) 90a43c1 [Qt] Code-movement-only: Format confirmation message in sendcoinsdialog (Cozz Lovan)
Diffstat (limited to 'src/primitives/transaction.h')
-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)