aboutsummaryrefslogtreecommitdiff
path: root/src/amount.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2021-08-09 23:27:38 +0100
committerRoss Nicoll <[email protected]>2021-08-17 08:50:42 +0100
commitce6e3d8137128e99b2f7f99f79327b8b440df0a2 (patch)
treeefcc20108c599f774d5df680eed7c91e7476b14b /src/amount.cpp
parentMerge pull request #2457 from ReverseControl/1.14.4-suggested-changes-for-2297 (diff)
downloaddiscoin-ce6e3d8137128e99b2f7f99f79327b8b440df0a2.tar.xz
discoin-ce6e3d8137128e99b2f7f99f79327b8b440df0a2.zip
Remove relay-only rounding
Remove rounding of transaction sizes when calculating fee minimums for relaying, to simplify fee logic.
Diffstat (limited to 'src/amount.cpp')
-rw-r--r--src/amount.cpp10
1 files changed, 10 insertions, 0 deletions
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<int64_t>::max()));
+ int64_t nSize = int64_t(nBytes_);
+
CAmount nFee = nSatoshisPerK * nSize / 1000;
if (nFee == 0 && nSize != 0) {