Remove dustRelayFee as it is no longer used

DustRelayFee (-dustrelayfee) was used sporadically throughout the
code, even though it had been disabled for dust determination, but
has now completely been removed from all dust and fee related
queries. Therefore, it can be removed from the code.

Moves the warning from DUST_RELAY_TX_FEE to DEFAULT_HARD_DUST_LIMIT
as it is very relevant for the latter, but never was relevant for
the former as it was disabled for us.
This commit is contained in:
Patrick Lodder 2021-10-10 01:16:28 +02:00
parent fd6da81954
commit 6173ca37cd
No known key found for this signature in database
GPG Key ID: 2D3A345B98D0DC1F
3 changed files with 5 additions and 18 deletions

View File

@ -473,7 +473,6 @@ std::string HelpMessage(HelpMessageMode mode)
if (showDebug) {
strUsage += HelpMessageOpt("-acceptnonstdtxn", strprintf("Relay and mine \"non-standard\" transactions (%sdefault: %u)", "testnet/regtest only; ", !Params(CBaseChainParams::TESTNET).RequireStandard()));
strUsage += HelpMessageOpt("-incrementalrelayfee=<amt>", strprintf("Fee rate (in %s/kB) used to define cost of relay, used for mempool limiting and BIP 125 replacement. (default: %s)", CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE)));
strUsage += HelpMessageOpt("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kB) used to defined dust, the value of an output such that it will cost about 1/3 of its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)));
}
strUsage += HelpMessageOpt("-dustlimit=<amt>", strprintf(_("Amount under which a transaction output is considered dust, in %s (default: %s)"), CURRENCY_UNIT, FormatMoney(DEFAULT_DUST_LIMIT)));
strUsage += HelpMessageOpt("-harddustlimit=<amt>", strprintf(_("Amount under which a transaction output is considered non-standard and will not be accepted or relayed, in %s (default: %s)"), CURRENCY_UNIT, FormatMoney(DEFAULT_HARD_DUST_LIMIT)));
@ -1030,16 +1029,6 @@ bool AppInitParameterInteraction()
return InitError(AmountErrMsg("blockmintxfee", GetArg("-blockmintxfee", "")));
}
// Feerate used to define dust. Shouldn't be changed lightly as old
// implementations may inadvertently create non-standard transactions
if (IsArgSet("-dustrelayfee"))
{
CAmount n = 0;
if (!ParseMoney(GetArg("-dustrelayfee", ""), n) || 0 == n)
return InitError(AmountErrMsg("dustrelayfee", GetArg("-dustrelayfee", "")));
dustRelayFee = CFeeRate(n);
}
fRequireStandard = !GetBoolArg("-acceptnonstdtxn", !chainparams.RequireStandard());
if (chainparams.RequireStandard() && !fRequireStandard)
return InitError(strprintf("acceptnonstdtxn is not currently supported for %s chain", chainparams.NetworkIDString()));

View File

@ -207,7 +207,6 @@ bool IsWitnessStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs)
}
CFeeRate incrementalRelayFee = CFeeRate(DEFAULT_INCREMENTAL_RELAY_FEE);
CFeeRate dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE);
unsigned int nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP;
CAmount nDustLimit = DEFAULT_DUST_LIMIT;
CAmount nHardDustLimit = DEFAULT_HARD_DUST_LIMIT;

View File

@ -61,12 +61,6 @@ static const unsigned int MAX_STANDARD_P2WSH_STACK_ITEMS = 100;
static const unsigned int MAX_STANDARD_P2WSH_STACK_ITEM_SIZE = 80;
/** The maximum size of a standard witnessScript */
static const unsigned int MAX_STANDARD_P2WSH_SCRIPT_SIZE = 3600;
/** Min feerate for defining dust. Historically this has been the same as the
* minRelayTxFee, however changing the dust limit changes which transactions are
* standard and should be done with care and ideally rarely. It makes sense to
* only increase the dust limit after prior releases were already not creating
* outputs below the new threshold */
static const CAmount DUST_RELAY_TX_FEE = RECOMMENDED_MIN_TX_FEE / 1000;
/**
* Dogecoin: Default dust limit that is evaluated when considering whether a
* transaction output is required to pay additional fee for relay and inclusion
@ -77,6 +71,11 @@ static const CAmount DEFAULT_DUST_LIMIT = RECOMMENDED_MIN_TX_FEE;
* Dogecoin: Default hard dust limit that is evaluated when considering whether
* a transaction is standard. Transactions under this limit will not be accepted
* to the mempool and thus not relayed. Can be overridden by -harddustlimit
*
* Changing the hard dust limit changes which transactions are standard and
* should be done with care and ideally rarely. It makes sense to only increase
* this limit after prior releases were already not creating outputs below the
* new threshold
*/
static const CAmount DEFAULT_HARD_DUST_LIMIT = DEFAULT_DUST_LIMIT / 10;