do an extra CheckBlock in ConnectBlock

This commit is contained in:
Satoshi Nakamoto
2010-08-16 20:55:54 +00:00
committed by Gavin Andresen
parent 21ca2d833b
commit 43deefa435
3 changed files with 6 additions and 13 deletions

View File

@@ -1107,6 +1107,10 @@ bool CBlock::DisconnectBlock(CTxDB& txdb, CBlockIndex* pindex)
bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
{
// Check it again in case a previous version let a bad block in
if (!CheckBlock())
return false;
//// issue here: it doesn't know the version
unsigned int nTxPos = pindex->nBlockPos + ::GetSerializeSize(CBlock(), SER_DISK) - 1 + GetSizeOfCompactSize(vtx.size());