From c81d7632e9dc8741ddb33e7f605f654bf3f9da09 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sat, 13 Jun 2015 08:19:48 +0000 Subject: Add Dogecoin current fee calculation logic Introduces 1 COIN/kb fees, rounded up to the next 1 COIN. Disable free transactions Dust outputs incur a 1 COIN additional fee Add unit tests for fee calculation Update existing unit tests with higher transaction values so that transactions are still standard --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index ded32eb03..e4f30906f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -66,7 +66,7 @@ uint64_t nPruneTarget = 0; bool fAlerts = DEFAULT_ALERTS; /** Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) */ -CFeeRate minRelayTxFee = CFeeRate(1000); +CFeeRate minRelayTxFee = CFeeRate(COIN); CTxMemPool mempool(::minRelayTxFee); @@ -867,8 +867,10 @@ CAmount GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowF } CAmount nMinFee = ::minRelayTxFee.GetFee(nBytes); + nMinFee += GetDogecoinDustFee(tx.vout, ::minRelayTxFee); - if (fAllowFree) + // Dogecoin: Disable free transactions + /* 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 @@ -876,7 +878,7 @@ CAmount GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowF // 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; -- cgit v1.2.3