From ce6e3d8137128e99b2f7f99f79327b8b440df0a2 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Mon, 9 Aug 2021 23:27:38 +0100 Subject: Remove relay-only rounding Remove rounding of transaction sizes when calculating fee minimums for relaying, to simplify fee logic. --- src/amount.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/amount.cpp') diff --git a/src/amount.cpp b/src/amount.cpp index 176c0be85..aa6bf943e 100644 --- a/src/amount.cpp +++ b/src/amount.cpp @@ -30,6 +30,16 @@ CAmount CFeeRate::GetFee(size_t nBytes_) const nSize = nSize + 1000 - (nSize % 1000); } + return GetRelayFee(nSize); +} + +// Dogecoin: Specifically for 1.14.4 we lower accepted relay fees by removing rounding, +// in 1.14.5 we should unify the GetFee() functions again. +CAmount CFeeRate::GetRelayFee(size_t nBytes_) const +{ + assert(nBytes_ <= uint64_t(std::numeric_limits::max())); + int64_t nSize = int64_t(nBytes_); + CAmount nFee = nSatoshisPerK * nSize / 1000; if (nFee == 0 && nSize != 0) { -- cgit v1.2.3