aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlangerhans <[email protected]>2014-05-02 22:45:46 +0200
committerlangerhans <[email protected]>2014-05-02 22:45:46 +0200
commit5e2a4570e33747556bd7a8bdcdac8dbcd4b29c30 (patch)
tree85b00e0cbffcddede895baf4f930182147804606
parentMerge pull request #499 from leofidus/qtproject (diff)
parentdon't send feeless transactions (diff)
downloaddiscoin-5e2a4570e33747556bd7a8bdcdac8dbcd4b29c30.tar.xz
discoin-5e2a4570e33747556bd7a8bdcdac8dbcd4b29c30.zip
Merge pull request #496 from leofidus/1.7-fees
fee changes
-rw-r--r--src/main.cpp37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 38f567661..dd769286a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -698,40 +698,17 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
}
int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode)
-{
- unsigned int nBlockSize = 1000;
- unsigned int nNewBlockSize = nBlockSize + nBytes;
-
+{
// Base fee is either nMinTxFee or nMinRelayTxFee
int64_t nBaseFee = (mode == GMF_RELAY) ? tx.nMinRelayTxFee : tx.nMinTxFee;
int64_t nMinFee = (1 + (int64_t)nBytes / 1000) * nBaseFee;
- if (fAllowFree)
+ if (fAllowFree && mode != GMF_SEND)
{
- if (nBlockSize == 1)
- {
- // Transactions under 10K are free
- // (about 4500bc if made of 50bc inputs)
- if (nBytes < 10000)
- nMinFee = 0;
- }
- else
- {
// Free transaction area
- if (nNewBlockSize < 27000)
+ if (nBytes < 26000)
nMinFee = 0;
- }
-#if 0
- // 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 we are creating a transaction we allow transactions up to 5,000 bytes
- // to be considered safe and assume they can likely make it into this section.
- if (nBytes < (mode == GMF_SEND ? 5000 : (DEFAULT_BLOCK_PRIORITY_SIZE - 1000)))
- nMinFee = 0;
-#endif
}
// Dogecoin
@@ -740,14 +717,6 @@ int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree,
if (txout.nValue < DUST_SOFT_LIMIT)
nMinFee += nBaseFee;
- // Raise the price as the block approaches full
- if (nBlockSize != 1 && nNewBlockSize >= DEFAULT_BLOCK_MAX_SIZE/2)
- {
- if (nNewBlockSize >= DEFAULT_BLOCK_MAX_SIZE)
- return MAX_MONEY;
- nMinFee *= DEFAULT_BLOCK_MAX_SIZE / (DEFAULT_BLOCK_MAX_SIZE - nNewBlockSize);
- }
-
if (!MoneyRange(nMinFee))
nMinFee = MAX_MONEY;
return nMinFee;