diff options
author | Jeff Garzik <jgarzik@bitpay.com> | 2013-06-24 15:09:50 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@bitpay.com> | 2013-10-02 11:49:43 -0400 |
commit | a79342479f577013f2fd2573fb32585d6f4981b3 (patch) | |
tree | dccd44003e725234363f2e95a3fb61e1ae24e486 /src/main.cpp | |
parent | 28f6b8dbad27f0dac72daca6f1bfe41d7e701908 (diff) |
Relay OP_RETURN data TxOut as standard transaction type
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
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; } |