aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
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 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;
}