allow any number of op return outputs in a transaction

This commit is contained in:
Gregory Sanders 2018-02-05 10:28:52 -05:00
parent d207f2754b
commit 904d35f899

View file

@ -85,7 +85,6 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes
}
}
unsigned int nDataOut = 0;
txnouttype whichType;
BOOST_FOREACH(const CTxOut& txout, tx.vout) {
if (!::IsStandard(txout.scriptPubKey, whichType, witnessEnabled) && !txout.IsFee()) {
@ -93,9 +92,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes
return false;
}
if (whichType == TX_NULL_DATA)
nDataOut++;
else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {
if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {
reason = "bare-multisig";
return false;
} else if ((txout.nAsset.IsExplicit() && txout.nAsset.GetAsset() == policyAsset) && txout.IsDust(dustRelayFee)) {
@ -104,12 +101,6 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes
}
}
// only one OP_RETURN txout is permitted
if (nDataOut > 1) {
reason = "multi-op-return";
return false;
}
return true;
}