From a880b29cab0fe95161b54b61159321021d5a3219 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 14 Dec 2011 01:03:55 -0500 Subject: Bugfix: fForRelay should be false when deciding required fee to include in blocks During the rushed transition from 0.01 BTC to 0.0005 BTC fees, we took the approach of dropping the relay and block-inclusion fee to 0.0005 BTC immediately, and only delayed adjusting the sending fee for the next release. Afterward, the relay fee was lowered to 0.0001 BTC to avoid having the same problem in the future. However, the block inclusion code was left setting fForRelay to true! This fixes that, so the lower 0.0001 BTC allowance is (as intended) only permitted for real relaying. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 6a3bacc78e..59db0aaf04 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2757,7 +2757,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) // Transaction fee required depends on block size bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority)); - int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree, true); + 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 -- cgit v1.2.3 From dbbf1d4a48c8761a67a4477bef48f17c0badef7b Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 3 Oct 2011 12:55:47 -0400 Subject: GetMinFee takes a mode parameter (GMF_{BLOCK,RELAY,SEND}) instead of fForRelay --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 59db0aaf04..807279a553 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -419,7 +419,7 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi } // Don't accept it if it can't get into a block - if (nFees < GetMinFee(1000, true, true)) + if (nFees < GetMinFee(1000, true, GMF_RELAY)) return error("AcceptToMemoryPool() : not enough fees"); // Continuously rate-limit free transactions @@ -2757,7 +2757,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) // Transaction fee required depends on block size bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority)); - int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree); + int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree, GMF_BLOCK); // Connecting shouldn't fail due to dependency on other memory pool transactions // because we're already processing them in order of dependency -- cgit v1.2.3