aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
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/init.cpp
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/init.cpp')
-rw-r--r--src/init.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 3845cfad81..058b6a06e5 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -583,6 +583,28 @@ bool AppInit2(boost::thread_group& threadGroup)
const char* pszP2SH = "/P2SH/";
COINBASE_FLAGS << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH));
+ // Fee-per-kilobyte amount considered the same as "free"
+ // If you are mining, be careful setting this:
+ // if you set it to zero then
+ // a transaction spammer can cheaply fill blocks using
+ // 1-satoshi-fee transactions. It should be set above the real
+ // cost to you of processing a transaction.
+ if (mapArgs.count("-mintxfee"))
+ {
+ int64 n = 0;
+ if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0)
+ CTransaction::nMinTxFee = n;
+ else
+ return InitError(strprintf(_("Invalid amount for -mintxfee=<amount>: '%s'"), mapArgs["-mintxfee"].c_str()));
+ }
+ if (mapArgs.count("-minrelaytxfee"))
+ {
+ int64 n = 0;
+ if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0)
+ CTransaction::nMinRelayTxFee = n;
+ else
+ return InitError(strprintf(_("Invalid amount for -minrelaytxfee=<amount>: '%s'"), mapArgs["-minrelaytxfee"].c_str()));
+ }
if (mapArgs.count("-paytxfee"))
{