aboutsummaryrefslogtreecommitdiff
path: root/src/dogecoin.cpp
diff options
context:
space:
mode:
authorMichi Lumin <[email protected]>2021-05-06 15:30:55 -0600
committermichilumin <[email protected]>2021-07-30 16:07:22 -0600
commit575f734eec14b122b2e460dcefb56a54840ea479 (patch)
tree7765fbeda190b3630de9810f4b246a7c1c0c5e75 /src/dogecoin.cpp
parentMerge pull request #2426 from xanimo/1.14.4-qa (diff)
downloaddiscoin-575f734eec14b122b2e460dcefb56a54840ea479.tar.xz
discoin-575f734eec14b122b2e460dcefb56a54840ea479.zip
Initial back end framework to separate wallet and relay fees + dust.
Diffstat (limited to 'src/dogecoin.cpp')
-rw-r--r--src/dogecoin.cpp40
1 files changed, 1 insertions, 39 deletions
diff --git a/src/dogecoin.cpp b/src/dogecoin.cpp
index 5336d625b..da426c9f3 100644
--- a/src/dogecoin.cpp
+++ b/src/dogecoin.cpp
@@ -11,6 +11,7 @@
#include "txmempool.h"
#include "util.h"
#include "validation.h"
+#include "dogecoin-fees.h"
int static generateMTRandom(unsigned int s, int range)
{
@@ -146,43 +147,4 @@ CAmount GetDogecoinBlockSubsidy(int nHeight, const Consensus::Params& consensusP
}
}
-CAmount GetDogecoinMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree)
-{
- {
- LOCK(mempool.cs);
- uint256 hash = tx.GetHash();
- double dPriorityDelta = 0;
- CAmount nFeeDelta = 0;
- mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta);
- if (dPriorityDelta > 0 || nFeeDelta > 0)
- return 0;
- }
-
- CAmount nMinFee = ::minRelayTxFee.GetFee(nBytes);
- nMinFee += GetDogecoinDustFee(tx.vout, ::minRelayTxFee);
-
- if (fAllowFree)
- {
- // There is a free transaction area in blocks created by most miners,
- // * If we are relaying we allow transactions up to DEFAULT_BLOCK_PRIORITY_SIZE - 1000
- // to be considered to fall into this category. We don't want to encourage sending
- // multiple transactions instead of one big transaction to avoid fees.
- if (nBytes < (DEFAULT_BLOCK_PRIORITY_SIZE - 1000))
- nMinFee = 0;
- }
-
- if (!MoneyRange(nMinFee))
- nMinFee = MAX_MONEY;
- return nMinFee;
-}
-CAmount GetDogecoinDustFee(const std::vector<CTxOut> &vout, CFeeRate &baseFeeRate) {
- CAmount nFee = 0;
-
- // To limit dust spam, add base fee for each output less than a COIN
- BOOST_FOREACH(const CTxOut& txout, vout)
- if (txout.IsDust(::minRelayTxFee))
- nFee += baseFeeRate.GetFeePerK();
-
- return nFee;
-}