Skip to content

Commit

Permalink
Merge bitcoin#11026: Bugfix: Use testnet RequireStandard for -acceptn…
Browse files Browse the repository at this point in the history
…onstdtxn default

4aa2508 Bugfix: Use testnet RequireStandard for -acceptnonstdtxn default (Luke Dashjr)

Pull request description:

  Fixes a bug introduced in bitcoin#8855

  `-acceptnonstdtxn` is a valid option only for testnet/regtest (in Core), and the help message reflects that. Currently, however, it is buggy in two ways:

  1. It uses mainnet to get the default value, which doesn't make sense since the option is never available for mainnet, and the only time the option is available, is when the default is the opposite.
  2. It uses the value of "require standard" directly as the default for "accept non-standard transactions", but these concepts are opposites: a negation must be performed to transform one to the other.

  Note the combination of these bugs results in the correct boolean output, but the logic to get there is completely wrong.

Tree-SHA512: 06ce513f59ba31f7ab4b6422a08a17bb37a5652dea4c38a4bbefedd5e2752d17bfccc32a4b0508068fa4783e316bff00a821ef18a24b1a2bb02859995d188fdc
  • Loading branch information
laanwj authored and PastaPastaPasta committed Sep 24, 2019
1 parent d4f925e commit cdd561b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ std::string HelpMessage(HelpMessageMode mode)

strUsage += HelpMessageGroup(_("Node relay options:"));
if (showDebug) {
strUsage += HelpMessageOpt("-acceptnonstdtxn", strprintf("Relay and mine \"non-standard\" transactions (%sdefault: %u)", "testnet/regtest only; ", defaultChainParams->RequireStandard()));
strUsage += HelpMessageOpt("-acceptnonstdtxn", strprintf("Relay and mine \"non-standard\" transactions (%sdefault: %u)", "testnet/regtest only; ", !testnetChainParams->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 more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)));
}
Expand Down

0 comments on commit cdd561b

Please sign in to comment.