aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-11-16 09:55:07 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-16 09:55:07 +0100
commit3443adecf100181c6e668f2e7a09bf2cfd794621 (patch)
tree787a1f65ce54baeebc4702c3b7c4baa1ddf732ba /src/main.cpp
parent0b4bd485ba33ab592b4aac759bcd3db6362a3b2f (diff)
parent6a86c24db146d9ca5d1d5c83099d935c3feb63bb (diff)
Merge pull request #3253
6a86c24 Coin Control Features (Cozz Lovan) 8dfd8c6 pass nBytes as parameter to GetMinFee(..) (Cozz Lovan)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 72245137ed..15fc8a24c3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -599,12 +599,11 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
return true;
}
-int64_t GetMinFee(const CTransaction& tx, bool fAllowFree, enum GetMinFee_mode mode)
+int64_t GetMinFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree, enum GetMinFee_mode mode)
{
// Base fee is either nMinTxFee or nMinRelayTxFee
int64_t nBaseFee = (mode == GMF_RELAY) ? tx.nMinRelayTxFee : tx.nMinTxFee;
- unsigned int nBytes = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
int64_t nMinFee = (1 + (int64_t)nBytes / 1000) * nBaseFee;
if (fAllowFree)
@@ -740,7 +739,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
unsigned int nSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
// Don't accept it if it can't get into a block
- int64_t txMinFee = GetMinFee(tx, true, GMF_RELAY);
+ int64_t txMinFee = GetMinFee(tx, nSize, true, GMF_RELAY);
if (fLimitFree && nFees < txMinFee)
return state.DoS(0, error("AcceptToMemoryPool : not enough fees %s, %"PRId64" < %"PRId64,
hash.ToString().c_str(), nFees, txMinFee),