Merge #15193: Default -whitelistforcerelay to off

a36d97d866 Default -whitelistforcerelay to off (Suhas Daftuar)

Pull request description:

  No one seems to use this "feature", and at any rate the behavior of relaying transactions when they violate local policy is error-prone, if we ever consider changing the ban behavior of our software from one version to the next.

  Defaulting this to off means that users who use -whitelist won't be unexpectedly surprised by this interaction.  If anyone is still relying on this feature, it can still be explicitly turned on.

Tree-SHA512: 52650ad464a728d1648f496751e3f713077ea3a1de7278ed03531b2e8723e63cf2f6f41b56c98c0f73ffa22c36e01d9170b409ab452c737aca35b7ecd7a6b448
This commit is contained in:
Wladimir J. van der Laan 2019-01-24 15:19:47 +01:00
commit 72bd4ab867
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D
3 changed files with 10 additions and 2 deletions

View file

@ -111,6 +111,14 @@ Configuration option changes
ambiguous whether the hash character is meant for the password or as a ambiguous whether the hash character is meant for the password or as a
comment. comment.
- The `whitelistforcerelay` option is used to relay transactions from
whitelisted peers even when not accepted to the mempool. This option now
defaults to being off, so that changes in policy and disconnect/ban behavior
will not cause a node that is whitelisting another to be dropped by peers.
Users can still explicitly enable this behavior with the command line option
(and may want to consider letting the Bitcoin Core project know about their
use-case, as this feature could be deprecated in the future).
Documentation Documentation
------------- -------------

View file

@ -50,7 +50,7 @@ struct LockPoints;
/** Default for -whitelistrelay. */ /** Default for -whitelistrelay. */
static const bool DEFAULT_WHITELISTRELAY = true; static const bool DEFAULT_WHITELISTRELAY = true;
/** Default for -whitelistforcerelay. */ /** Default for -whitelistforcerelay. */
static const bool DEFAULT_WHITELISTFORCERELAY = true; static const bool DEFAULT_WHITELISTFORCERELAY = false;
/** Default for -minrelaytxfee, minimum relay fee for transactions */ /** Default for -minrelaytxfee, minimum relay fee for transactions */
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000; static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000;
//! -maxtxfee default //! -maxtxfee default

View file

@ -755,7 +755,7 @@ class SegWitTest(BitcoinTestFramework):
spend_tx.vin[0].scriptSig = CScript([p2wsh_pubkey, b'a']) spend_tx.vin[0].scriptSig = CScript([p2wsh_pubkey, b'a'])
spend_tx.rehash() spend_tx.rehash()
with self.nodes[0].assert_debug_log( with self.nodes[0].assert_debug_log(
expected_msgs=('Not relaying invalid transaction {}'.format(spend_tx.hash), 'was not accepted: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)')): expected_msgs=(spend_tx.hash, 'was not accepted: mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)')):
test_transaction_acceptance(self.nodes[0], self.test_node, spend_tx, with_witness=False, accepted=False) test_transaction_acceptance(self.nodes[0], self.test_node, spend_tx, with_witness=False, accepted=False)
# Now put the witness script in the witness, should succeed after # Now put the witness script in the witness, should succeed after