diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -725,16 +725,9 @@ extraFlags |= SCRIPT_ENABLE_SCHNORR; } - // Check inputs based on the set of flags we activate. - uint32_t scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS; - if (!config.GetChainParams().RequireStandard()) { - scriptVerifyFlags = - SCRIPT_ENABLE_SIGHASH_FORKID | - gArgs.GetArg("-promiscuousmempoolflags", scriptVerifyFlags); - } - // Make sure whatever we need to activate is actually activated. - scriptVerifyFlags |= extraFlags; + const uint32_t scriptVerifyFlags = + STANDARD_SCRIPT_VERIFY_FLAGS | extraFlags; // Check against previous transactions. This is done last to help // prevent CPU exhaustion denial-of-service attacks. @@ -766,28 +759,9 @@ if (!CheckInputsFromMempoolAndCache(tx, state, view, pool, currentBlockScriptVerifyFlags, true, txdata)) { - // If we're using promiscuousmempoolflags, we may hit this normally. - // Check if current block has some flags that scriptVerifyFlags does - // not before printing an ominous warning. - if (!(~scriptVerifyFlags & currentBlockScriptVerifyFlags)) { - return error( - "%s: BUG! PLEASE REPORT THIS! ConnectInputs failed against " - "MANDATORY but not STANDARD flags %s, %s", - __func__, txid.ToString(), FormatStateMessage(state)); - } - - if (!CheckInputs(tx, state, view, true, - MANDATORY_SCRIPT_VERIFY_FLAGS | extraFlags, true, - false, txdata)) { - return error( - "%s: ConnectInputs failed against MANDATORY but not " - "STANDARD flags due to promiscuous mempool %s, %s", - __func__, txid.ToString(), FormatStateMessage(state)); - } - - LogPrintf("Warning: -promiscuousmempool flags set to not include " - "currently enforced soft forks, this may break mining or " - "otherwise cause instability!\n"); + return error("%s: BUG! PLEASE REPORT THIS! CheckInputs failed " + "against latest-block but not STANDARD flags %s, %s", + __func__, txid.ToString(), FormatStateMessage(state)); } if (test_accept) { diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -97,8 +97,7 @@ class BIP65Test(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 - self.extra_args = [ - ['-promiscuousmempoolflags=1', '-whitelist=127.0.0.1']] + self.extra_args = [['-whitelist=127.0.0.1']] self.setup_clean_chain = True def run_test(self): @@ -179,11 +178,14 @@ # This block is valid assert_equal(self.nodes[0].getbestblockhash(), block.hash) - # We show that this tx is valid except for CLTV by getting it - # accepted to the mempool (which we can achieve with - # -promiscuousmempoolflags). - self.nodes[0].p2p.send_and_ping(msg_tx(spendtx)) - assert spendtx.hash in self.nodes[0].getrawmempool() + # We show that this tx is invalid due to CLTV by getting it + # rejected from the mempool for exactly that reason. + assert_equal( + [{'txid': spendtx.hash, 'allowed': False, + 'reject-reason': '64: non-mandatory-script-verify-flag (Negative locktime)'}], + self.nodes[0].testmempoolaccept( + rawtxs=[spendtx.serialize().hex()], allowhighfees=True) + ) rejectedtx_signed = self.nodes[0].signrawtransactionwithwallet( ToHex(spendtx)) diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py --- a/test/functional/feature_dersig.py +++ b/test/functional/feature_dersig.py @@ -8,7 +8,7 @@ """ from test_framework.blocktools import create_block, create_coinbase -from test_framework.messages import CTransaction, FromHex, msg_block +from test_framework.messages import CTransaction, FromHex, msg_block, ToHex from test_framework.mininode import ( mininode_lock, network_thread_start, @@ -56,8 +56,7 @@ class BIP66Test(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 - self.extra_args = [ - ['-promiscuousmempoolflags=1', '-whitelist=127.0.0.1']] + self.extra_args = [['-whitelist=127.0.0.1']] self.setup_clean_chain = True def run_test(self): @@ -103,7 +102,16 @@ unDERify(spendtx) spendtx.rehash() - # Now we verify that a block with this transaction is invalid. + # First we show that this tx is valid except for DERSIG by getting it + # rejected from the mempool for exactly that reason. + assert_equal( + [{'txid': spendtx.hash, 'allowed': False, + 'reject-reason': '16: mandatory-script-verify-flag-failed (Non-canonical DER signature)'}], + self.nodes[0].testmempoolaccept( + rawtxs=[ToHex(spendtx)], allowhighfees=True) + ) + + # Now we verify that a block with this transaction is also invalid. block.vtx.append(spendtx) block.hashMerkleRoot = block.calc_merkle_root() block.rehash() diff --git a/test/lint/check-doc.py b/test/lint/check-doc.py --- a/test/lint/check-doc.py +++ b/test/lint/check-doc.py @@ -37,7 +37,6 @@ '-h', '-help', '-parkdeepreorg', - '-promiscuousmempoolflags', '-replayprotectionactivationtime', '-rpcssl', '-socks',