Skip to content

Commit eada04e

Browse files
committed
Do not print soft-fork-script warning with -promiscuousmempool
1 parent b5fea8d commit eada04e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/validation.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,20 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
784784
unsigned int currentBlockScriptVerifyFlags = GetBlockScriptFlags(chainActive.Tip(), Params().GetConsensus());
785785
if (!CheckInputs(tx, state, view, true, currentBlockScriptVerifyFlags, true, true, txdata))
786786
{
787-
return error("%s: BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags %s, %s",
788-
__func__, hash.ToString(), FormatStateMessage(state));
787+
// If we're using promiscuousmempoolflags, we may hit this normally
788+
// Check if current block has some flags that scriptVerifyFlags
789+
// does not before printing an ominous warning
790+
if (!(~scriptVerifyFlags & currentBlockScriptVerifyFlags)) {
791+
return error("%s: BUG! PLEASE REPORT THIS! ConnectInputs failed against latest-block but not STANDARD flags %s, %s",
792+
__func__, hash.ToString(), FormatStateMessage(state));
793+
} else {
794+
if (!CheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, false, txdata)) {
795+
return error("%s: ConnectInputs failed against MANDATORY but not STANDARD flags due to promiscuous mempool %s, %s",
796+
__func__, hash.ToString(), FormatStateMessage(state));
797+
} else {
798+
LogPrintf("Warning: -promiscuousmempool flags set to not include currently enforced soft forks, this may break mining or otherwise cause instability!\n");
799+
}
800+
}
789801
}
790802

791803
// Remove conflicting transactions from the mempool

0 commit comments

Comments
 (0)