aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-05-04 10:15:39 -0700
committerGavin Andresen <gavinandresen@gmail.com>2013-05-04 10:15:39 -0700
commit33edd0a477f4448be9c6c4949fbff4e53f16cac6 (patch)
tree52fce70249d5eff657c7cad299c84beaf85efcfe /src/init.cpp
parentf309cb76c2c932317307d51961ca25cf051eb255 (diff)
parent000dc55181f77cd96076c76b2cc13f8bcbe4146e (diff)
Merge pull request #2577 from gavinandresen/fee_bandaid
Treat dust outputs as non-standard, un-hardcode TX_FEE constants
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 472af5331b..d619cb4121 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -582,6 +582,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"))
{