This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Prevent chain extension beyond snapshot height

  • Loading branch information...
protinam committed Dec 29, 2017
1 parent e9e9f6b commit 19c50368313a9e0122eadb9af7e81e88e588855e
Showing with 5 additions and 0 deletions.
  1. +4 −0 src/main.cpp
  2. +1 −0 src/main.h
View
@@ -1952,6 +1952,10 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos, const u
pindexNew->nHeight = pindexNew->pprev->nHeight + 1;
}
// Prevent chain extension beyond snapshot height
if (pindexNew->nHeight > SNAPSHOT_BLOCK)
return error("AddToBlockIndex() : not extending past snapshot block");
// wyvern: compute chain trust score
pindexNew->nChainTrust = (pindexNew->pprev ? pindexNew->pprev->nChainTrust : 0) + pindexNew->GetBlockTrust();
View
@@ -26,6 +26,7 @@ class CInv;
class CRequestTracker;
class CNode;
static const int SNAPSHOT_BLOCK = 315000;
static const int LAST_POW_BLOCK = 1996900;
static const unsigned int MAX_BLOCK_SIZE = 2000000;

0 comments on commit 19c5036

Please sign in to comment.