Skip to content

Commit

Permalink
Merge pull request #5270
Browse files Browse the repository at this point in the history
57425a2 Check block header before accepting it. (Daniel Kraft)
  • Loading branch information
laanwj committed Nov 20, 2014
2 parents 3ba5ebc + 57425a2 commit 5c4dffd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5c4dffd

Please sign in to comment.