From a79342479f577013f2fd2573fb32585d6f4981b3 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 24 Jun 2013 15:09:50 -0400 Subject: Relay OP_RETURN data TxOut as standard transaction type --- src/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index dc690111e6..ed48fd5760 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -497,17 +497,28 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return false; } } + + unsigned int nDataOut = 0; + txnouttype whichType; BOOST_FOREACH(const CTxOut& txout, tx.vout) { - if (!::IsStandard(txout.scriptPubKey)) { + if (!::IsStandard(txout.scriptPubKey, whichType)) { reason = "scriptpubkey"; return false; } - if (txout.IsDust(CTransaction::nMinRelayTxFee)) { + if (whichType == TX_NULL_DATA) + nDataOut++; + else if (txout.IsDust(CTransaction::nMinRelayTxFee)) { reason = "dust"; return false; } } + // only one OP_RETURN txout is permitted + if (nDataOut > 1) { + reason = "mucho-data"; + return false; + } + return true; } -- cgit v1.2.3