Merge branch '0.5.x' into 0.6.0.x

Conflicts:
	src/main.cpp
	src/serialize.h
This commit is contained in:
Luke Dashjr
2012-05-04 18:57:03 +00:00
5 changed files with 23 additions and 6 deletions
+20
View File
@@ -1659,6 +1659,26 @@ bool CBlock::CheckBlock() const
if (!tx.CheckTransaction())
return DoS(tx.nDoS, error("CheckBlock() : CheckTransaction failed"));
// Check for duplicate txids. This is caught by ConnectInputs(),
// but catching it earlier avoids a potential DoS attack:
set<uint256> uniqueTx;
BOOST_FOREACH(const CTransaction& tx, vtx)
{
uniqueTx.insert(tx.GetHash());
}
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<uint256> uniqueTx;
BOOST_FOREACH(const CTransaction& tx, vtx)
{
uniqueTx.insert(tx.GetHash());
}
if (uniqueTx.size() != vtx.size())
return error("CheckBlock() : duplicate transaction");
int nSigOps = 0;
BOOST_FOREACH(const CTransaction& tx, vtx)
{