aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-11-19 23:37:05 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-11-19 23:37:05 +0000
commitf35e21e2e4fcc0aa52edd9f9b58bd19e347597da (patch)
tree673d0a6e46e902b95d208085f77567635c4ab67d /main.cpp
parent683bcb9154422011ef01e8c5677bad2c4b323436 (diff)
require some minimal priority for free transactions to slow down transaction spam
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@185 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 6848342b71..8e32ee7c3c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -3197,6 +3197,7 @@ void BitcoinMiner()
while (!mapPriority.empty())
{
// Take highest priority transaction off priority queue
+ double dPriority = (*mapPriority.begin()).first;
CTransaction& tx = *(*mapPriority.begin()).second;
mapPriority.erase(mapPriority.begin());
@@ -3208,8 +3209,9 @@ void BitcoinMiner()
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
- // Transaction fee based on block size
- int64 nMinFee = tx.GetMinFee(nBlockSize);
+ // Transaction fee required depends on block size
+ bool fAllowFree = (nBlockSize + nTxSize < 4000 || dPriority > COIN * 144 / 250);
+ int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree);
// Connecting shouldn't fail due to dependency on other memory pool transactions
// because we're already processing them in order of dependency