diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-10-21 22:47:24 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-10-21 22:47:24 -0700 |
commit | be484db274e6de7e7b6880d04b2d84e20b719b9a (patch) | |
tree | cd0bef85a328ee5d111545f6862b9cbb42fd0aac /src/main.cpp | |
parent | 10dc3c74737eea1f2de694c6582caf3027926034 (diff) | |
parent | a79342479f577013f2fd2573fb32585d6f4981b3 (diff) |
Merge pull request #2738 from jgarzik/op_return
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 a5a0f031af..01a1babc7f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -469,17 +469,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; } |