aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-04-25 20:11:27 -0400
committerGavin Andresen <gavinandresen@gmail.com>2013-05-03 10:54:31 -0400
commit000dc55181f77cd96076c76b2cc13f8bcbe4146e (patch)
tree374d5c65a265dbd59b1957ec9c128cd056be7ef6 /src/main.h
parent1f00f4e9c9b4b643da22bb5d9f94d66683fa1a15 (diff)
downloadbitcoin-000dc55181f77cd96076c76b2cc13f8bcbe4146e.tar.xz
Un-hardcode TX_FEE constants
Allow setting of MIN_TX_FEE / MIN_RELAY_TX_FEE with -mintxfee / -mintxrelayfee Default values are the same (0.0001 BTC).
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/main.h b/src/main.h
index 8c1e6d265c..905b9fbacb 100644
--- a/src/main.h
+++ b/src/main.h
@@ -44,10 +44,6 @@ static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
/** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */
static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
-/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */
-static const int64 MIN_TX_FEE = 10000;
-/** Fees smaller than this (in satoshi) are considered zero fee (for relaying) */
-static const int64 MIN_RELAY_TX_FEE = 10000;
/** No amount larger than this (in satoshi) is valid */
static const int64 MAX_MONEY = 21000000 * COIN;
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
@@ -439,23 +435,7 @@ public:
return !(a == b);
}
- size_t size() const
- {
- return sizeof(nValue)+scriptPubKey.size();
- }
-
- bool IsDust() const
- {
- // "Dust" is defined in terms of MIN_RELAY_TX_FEE, which
- // has units satoshis-per-kilobyte.
- // If you'd pay more than 1/3 in fees
- // to spend something, then we consider it dust.
- // A typical txout is 32 bytes big, and will
- // need a CTxIn of at least 148 bytes to spend,
- // so dust is a txout less than 54 uBTC
- // (5400 satoshis)
- return ((nValue*1000)/(3*(size()+148)) < MIN_RELAY_TX_FEE);
- }
+ bool IsDust() const;
std::string ToString() const
{
@@ -485,6 +465,8 @@ enum GetMinFee_mode
class CTransaction
{
public:
+ static int64 nMinTxFee;
+ static int64 nMinRelayTxFee;
static const int CURRENT_VERSION=1;
int nVersion;
std::vector<CTxIn> vin;