Merge pull request #5270

57425a2 Check block header before accepting it. (Daniel Kraft)
This commit is contained in:
Wladimir J. van der Laan 2014-11-20 15:41:45 +01:00
commit 5c4dffd188
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -2280,6 +2280,8 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
{
// These are checks that are independent of context.
// Check that the header is valid (particularly PoW). This is mostly
// redundant with the call in AcceptBlockHeader.
if (!CheckBlockHeader(block, state, fCheckPOW))
return false;
@ -2351,6 +2353,9 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
return true;
}
if (!CheckBlockHeader(block, state))
return false;
// Get prev block index
CBlockIndex* pindexPrev = NULL;
int nHeight = 0;