aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-10-21 22:47:24 -0700
committerGavin Andresen <[email protected]>2013-10-21 22:47:24 -0700
commitbe484db274e6de7e7b6880d04b2d84e20b719b9a (patch)
treecd0bef85a328ee5d111545f6862b9cbb42fd0aac /src/main.cpp
parentMerge branch 'bugfix_unknownoutputs' of git://github.com/luke-jr/bitcoin (diff)
parentRelay OP_RETURN data TxOut as standard transaction type (diff)
downloaddiscoin-be484db274e6de7e7b6880d04b2d84e20b719b9a.tar.xz
discoin-be484db274e6de7e7b6880d04b2d84e20b719b9a.zip
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.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a5a0f031a..01a1babc7 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;
}