aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2014-11-20 15:41:45 +0100
committerWladimir J. van der Laan <[email protected]>2014-11-20 15:41:58 +0100
commit5c4dffd188bf82c1965871bdf013b18a61e3d7d0 (patch)
tree5c98d3d454b8f8235acbf6ecabc6a91dcd5dc1db /src/main.cpp
parentMerge pull request #5000 (diff)
parentCheck block header before accepting it. (diff)
downloaddiscoin-5c4dffd188bf82c1965871bdf013b18a61e3d7d0.tar.xz
discoin-5c4dffd188bf82c1965871bdf013b18a61e3d7d0.zip
Merge pull request #5270
57425a2 Check block header before accepting it. (Daniel Kraft)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2bff781bf..ac5d42d5f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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;