From dcde53cb6ea2aa9317181c8e81fa1e17a33fc0b9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 24 Aug 2018 08:30:45 -1100 Subject: [PATCH] Hardcap on maxscriptsize --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index e1032ea09..9c7100a9e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1121,6 +1121,9 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio if ( (txout.nValue > 0 && iscoinbase == 0) || tx.GetJoinSplitValueOut() > 0 ) return state.DoS(100, error("CheckTransaction(): this is a private chain, no public allowed"),REJECT_INVALID, "bad-txns-acprivacy-chain"); } + if ( txout.scriptPubKey.size() > IGUANA_MAXSCRIPTSIZE ) + return state.DoS(100, error("CheckTransaction(): txout.scriptPubKey.size() too big"),REJECT_INVALID, "bad-txns-vout-negative"); + nValueOut += txout.nValue; if (!MoneyRange(nValueOut)) return state.DoS(100, error("CheckTransaction(): txout total out of range"),