| 21 | } |
| 22 | |
| 23 | CAmount CFeeRate::GetFee(size_t nBytes_) const |
| 24 | { |
| 25 | assert(nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max())); |
| 26 | int64_t nSize = int64_t(nBytes_); |
| 27 | |
| 28 | CAmount nFee = nSatoshisPerK * nSize / 1000; |
| 29 | |
| 30 | if (nFee == 0 && nSize != 0) { |
| 31 | if (nSatoshisPerK > 0) |
| 32 | nFee = CAmount(1); |
| 33 | if (nSatoshisPerK < 0) |
| 34 | nFee = CAmount(-1); |
| 35 | } |
| 36 | |
| 37 | return nFee; |
| 38 | } |
| 39 | |
| 40 | std::string CFeeRate::ToString() const |
| 41 | { |