diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-03-21 12:25:13 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-03-21 12:40:31 +0100 |
commit | ddfd79659e31a41de4e9b824767b766116798a90 (patch) | |
tree | b46036a67be44a0fac18c1e192451b6f4ef2b044 /src/amount.h | |
parent | 7b832d286bd1606c6fa54d6bf09a994cb0d34fb5 (diff) | |
parent | fad13b1612b5de16d94c78c1a464d431a4f770bf (diff) |
Merge #7705: [amount] Add tests and make GetFee() monotonic
fad13b1 [amount] Preempt issues with negative fee rates (MarcoFalke)
faf756a [amount] Make GetFee() monotonic (MarcoFalke)
fab6880 [qa] Add amount tests (MarcoFalke)
Diffstat (limited to 'src/amount.h')
-rw-r--r-- | src/amount.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/amount.h b/src/amount.h index a48b17d514..9aba6525c7 100644 --- a/src/amount.h +++ b/src/amount.h @@ -42,10 +42,14 @@ public: explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } CFeeRate(const CAmount& nFeePaid, size_t nSize); CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } - - CAmount GetFee(size_t size) const; // unit returned is satoshis - CAmount GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes - + /** + * Return the fee in satoshis for the given size in bytes. + */ + CAmount GetFee(size_t size) const; + /** + * Return the fee in satoshis for a size of 1000 bytes + */ + CAmount GetFeePerK() const { return GetFee(1000); } friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; } friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; } friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; } |