diff --git a/src/init.cpp b/src/init.cpp index 7458d4847..c034826d6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -479,7 +479,6 @@ std::string HelpMessage(HelpMessageMode mode) if (showDebug) strUsage += HelpMessageOpt("-mintxfee=", strprintf("Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)", CURRENCY_UNIT, FormatMoney(CWallet::minTxFee.GetFeePerK()))); - strUsage += HelpMessageOpt("-opretmintxfee=", strprintf(_("Minimum fee (in %s/kB) to allow for OP_RETURN transactions (default: %s)"), CURRENCY_UNIT, 400000 )); strUsage += HelpMessageOpt("-paytxfee=", strprintf(_("Fee (in %s/kB) to add to transactions you send (default: %s)"), CURRENCY_UNIT, FormatMoney(payTxFee.GetFeePerK()))); // If this is used incorrectly (-rescanheight too large), then the local wallet may attempt to spend funds which it does not have witness data about // which will cause a "missing inputs" error when added to the mempool. Rescanning from correct height will fix this. diff --git a/src/miner.cpp b/src/miner.cpp index 2b5c7c033..bb7582d7b 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -475,14 +475,10 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 // fprintf(stderr,"%s: nTxSize = %u\n", __func__, nTxSize); // Opret spam limits - if (mapArgs.count("-opretmintxfee")) + const bool opretminfee = true; + if (opretminfee) { - CAmount n = 0; - CFeeRate opretMinFeeRate; - if (ParseMoney(mapArgs["-opretmintxfee"], n) && n > 0) - opretMinFeeRate = CFeeRate(n); - else - opretMinFeeRate = CFeeRate(400000); // default opretMinFeeRate (1 HUSH per 250 Kb = 0.004 per 1 Kb = 400000 puposhis per 1 Kb) + CFeeRate opretMinFeeRate = CFeeRate(10000000); // default opretMinFeeRate 0.1 HUSH bool fSpamTx = false; unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); @@ -501,9 +497,13 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 } } - if ((nTxOpretSize > 256) && (feeRate < opretMinFeeRate)) fSpamTx = true; - // std::cerr << tx.GetHash().ToString() << " nTxSize." << nTxSize << " nTxOpretSize." << nTxOpretSize << " feeRate." << feeRate.ToString() << " opretMinFeeRate." << opretMinFeeRate.ToString() << " fSpamTx." << fSpamTx << std::endl; - if (fSpamTx) continue; + // opreturns of this size or smaller get amnesty and do not have to pay increased fees + int amnestySize = 128; + if ((nTxOpretSize > amnestySize) && (feeRate < opretMinFeeRate)) { + fSpamTx = true; + std::cerr << __func__ << ": " << tx.GetHash().ToString() << " nTxSize=" << nTxSize << " nTxOpretSize=" << nTxOpretSize << " feeRate=" << feeRate.ToString() << " opretMinFeeRate=" << opretMinFeeRate.ToString() << " fSpamTx=" << fSpamTx << std::endl; + continue; + } // std::cerr << tx.GetHash().ToString() << " vecPriority.size() = " << vecPriority.size() << std::endl; }