diff --git a/mempool.go b/mempool.go index d41f9462..ade8f6dc 100644 --- a/mempool.go +++ b/mempool.go @@ -905,8 +905,8 @@ func (mp *txMemPool) maybeAcceptTransaction(tx *btcutil.Tx, isOrphan *bool, isNe // Verify crypto signatures for each input and reject the transaction if // any don't verify. - flags := btcscript.ScriptBip16 | btcscript.ScriptCanonicalSignatures - err = btcchain.ValidateTransactionScripts(tx, txStore, flags) + err = btcchain.ValidateTransactionScripts(tx, txStore, + standardScriptVerifyFlags) if err != nil { return err } diff --git a/mining.go b/mining.go index abeb9525..b6899ea9 100644 --- a/mining.go +++ b/mining.go @@ -37,6 +37,17 @@ const ( // and is used to monitor BIP16 support as well as blocks that are // generated via btcd. coinbaseFlags = "/P2SH/btcd/" + + // standardScriptVerifyFlags are the script flags which are used when + // executing transaction scripts to enforce additional checks which + // are required for the script to be considered standard. These checks + // help reduce issues related to transaction malleability as well as + // allow pay-to-script hash transactions. Note these flags are + // different than what is required for the consensus rules in that they + // are more strict. + standardScriptVerifyFlags = btcscript.ScriptBip16 | + btcscript.ScriptCanonicalSignatures | + btcscript.ScriptStrictMultiSig ) // txPrioItem houses a transaction along with extra information that allows the @@ -669,8 +680,8 @@ mempoolLoop: logSkippedDeps(tx, deps) continue } - flags := btcscript.ScriptBip16 | btcscript.ScriptCanonicalSignatures - err = btcchain.ValidateTransactionScripts(tx, blockTxStore, flags) + err = btcchain.ValidateTransactionScripts(tx, blockTxStore, + standardScriptVerifyFlags) if err != nil { minrLog.Tracef("Skipping tx %s due to error in "+ "ValidateTransactionScripts: %v", tx.Sha(), err)