aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-12-06 00:29:09 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-12-06 00:29:09 +0000
commit107d9e288df8207e83f4273a8dcd631412f89889 (patch)
treef550451e284d79e0f67e583f6e7a4d369a29d4b4 /main.h
parent52f4cb48590a706caf7a492e8d94b85620d5cd33 (diff)
fix transaction fee bug in CreateTransaction, higher size cutoff for free transactions in GetMinFee
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@42 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.h')
-rw-r--r--main.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/main.h b/main.h
index 822045a573..716485e93d 100644
--- a/main.h
+++ b/main.h
@@ -512,14 +512,19 @@ public:
return nValueOut;
}
- int64 GetMinFee(bool fDiscount=false) const
+ int64 GetMinFee(unsigned int nBlockSize=1) const
{
// Base fee is 1 cent per kilobyte
unsigned int nBytes = ::GetSerializeSize(*this, SER_NETWORK);
int64 nMinFee = (1 + (int64)nBytes / 1000) * CENT;
- // First 100 transactions in a block are free
- if (fDiscount && nBytes < 10000)
+ // Transactions under 60K are free as long as block size is under 80K
+ // (about 27,000bc if made of 50bc inputs)
+ if (nBytes < 60000 && nBlockSize < 80000)
+ nMinFee = 0;
+
+ // Transactions under 3K are free as long as block size is under 200K
+ if (nBytes < 3000 && nBlockSize < 200000)
nMinFee = 0;
// To limit dust spam, require a 0.01 fee if any output is less than 0.01