Skip to content

Commit

Permalink
Merge pull request #5 from raven-dark/remove-dgw-validation
Browse files Browse the repository at this point in the history
remove dgw validation
  • Loading branch information
j4ys0n committed Feb 14, 2019
2 parents 2cdebec + 87d09db commit 9c38141
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 3)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
AC_INIT([RavenDark Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/ravendark/ravendark/issues],[ravendarkcore])
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Expand Up @@ -16,7 +16,7 @@
//! These need to be macros, as clientversion.cpp's and ravendark*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 3
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_REVISION 1

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
28 changes: 14 additions & 14 deletions src/validation.cpp
Expand Up @@ -3194,20 +3194,20 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
const Consensus::Params& consensusParams = Params().GetConsensus();
int nHeight = pindexPrev->nHeight + 1;
// Check proof of work
if(Params().NetworkIDString() == CBaseChainParams::MAIN && nHeight <= 68589){
// architecture issues with DGW v1 and v2)
unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, &block, consensusParams);
double n1 = ConvertBitsToDouble(block.nBits);
double n2 = ConvertBitsToDouble(nBitsNext);

if (abs(n1-n2) > n1*0.5)
return state.DoS(100, error("%s : incorrect proof of work (DGW pre-fork) - %f %f %f at %d", __func__, abs(n1-n2), n1, n2, nHeight),
REJECT_INVALID, "bad-diffbits");
} else {
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
return state.DoS(100, error("%s : incorrect proof of work at %d", __func__, nHeight),
REJECT_INVALID, "bad-diffbits");
}
// if(Params().NetworkIDString() == CBaseChainParams::MAIN && nHeight <= 68589){
// // architecture issues with DGW v1 and v2)
// unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, &block, consensusParams);
// double n1 = ConvertBitsToDouble(block.nBits);
// double n2 = ConvertBitsToDouble(nBitsNext);
//
// if (abs(n1-n2) > n1*0.5)
// return state.DoS(100, error("%s : incorrect proof of work (DGW pre-fork) - %f %f %f at %d", __func__, abs(n1-n2), n1, n2, nHeight),
// REJECT_INVALID, "bad-diffbits");
// } else {
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
return state.DoS(100, error("%s : incorrect proof of work at %d", __func__, nHeight),
REJECT_INVALID, "bad-diffbits");
// }

// Check timestamp against prev
if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
Expand Down

0 comments on commit 9c38141

Please sign in to comment.