From 02003157d577bb566f5d0c41e976d2e138470724 Mon Sep 17 00:00:00 2001 From: janko33bd Date: Wed, 6 Sep 2017 21:39:25 +0100 Subject: [PATCH] blackstat: ceil(x) Rounds x upward, returning the smallest integral value that is not less than x. SatoshisPerK*ceil(1 + nSize / 1000);` --- src/amount.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amount.cpp b/src/amount.cpp index aef67ed62..7de7fa113 100644 --- a/src/amount.cpp +++ b/src/amount.cpp @@ -4,6 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "amount.h" +#include "math.h" #include "tinyformat.h" @@ -19,7 +20,7 @@ CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) CAmount CFeeRate::GetFee(size_t nSize) const { - CAmount nFee = nSatoshisPerK*(1 + nSize / 1000); + CAmount nFee = nSatoshisPerK * ceil(1 + nSize / 1000); if (nFee == 0 && nSatoshisPerK > 0) nFee = nSatoshisPerK;