From: Luke Dashjr Date: Fri, 4 May 2012 19:55:54 +0000 (+0000) Subject: Merge branch '0.5.x' into 0.6.0.x X-Git-Tag: v0.4.0-unstable~129^2~1^2~18^2 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=ee932c6e35f40360fbc3bce44840a82b19599ea2 Merge branch '0.5.x' into 0.6.0.x Conflicts: src/main.cpp --- ee932c6e35f40360fbc3bce44840a82b19599ea2 diff --cc src/main.cpp index 0599b25,5f98d49..e78dc49 --- a/src/main.cpp +++ b/src/main.cpp @@@ -1669,22 -1502,8 +1669,12 @@@ bool CBlock::CheckBlock() cons if (uniqueTx.size() != vtx.size()) return DoS(100, error("CheckBlock() : duplicate transaction")); - // Check for duplicate txids. This is caught by ConnectInputs(), - // but catching it earlier avoids a potential DoS attack: - set uniqueTx; - BOOST_FOREACH(const CTransaction& tx, vtx) - { - uniqueTx.insert(tx.GetHash()); - } - if (uniqueTx.size() != vtx.size()) - return error("CheckBlock() : duplicate transaction"); - - // Check that it's not full of nonstandard transactions - if (GetSigOpCount() > MAX_BLOCK_SIGOPS) + int nSigOps = 0; + BOOST_FOREACH(const CTransaction& tx, vtx) + { + nSigOps += tx.GetLegacySigOpCount(); + } + if (nSigOps > MAX_BLOCK_SIGOPS) return DoS(100, error("CheckBlock() : out-of-bounds SigOpCount")); // Check merkleroot