test
This commit is contained in:
@@ -59,7 +59,7 @@ int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp)
|
|||||||
int32_t komodo_blockcheck(CBlock *block,uint32_t *nBitsp)
|
int32_t komodo_blockcheck(CBlock *block,uint32_t *nBitsp)
|
||||||
{
|
{
|
||||||
CBlockIndex *bindex = new CBlockIndex(block->GetBlockHeader());
|
CBlockIndex *bindex = new CBlockIndex(block->GetBlockHeader());
|
||||||
if ( bindex->nHeight <= NOTARIZED_HEIGHT )
|
if ( bindex != 0 && bindex->nHeight <= NOTARIZED_HEIGHT )
|
||||||
return(-1);
|
return(-1);
|
||||||
// 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS
|
// 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS
|
||||||
// -1 -> invalid, ie, prior to notarized block
|
// -1 -> invalid, ie, prior to notarized block
|
||||||
|
|||||||
@@ -2946,13 +2946,13 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne
|
|||||||
|
|
||||||
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW)
|
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW)
|
||||||
{
|
{
|
||||||
int32_t retval; uint32_t nBits; CBlockIndex *bindex = new CBlockIndex(block);
|
int32_t retval; uint32_t nBits; //CBlockIndex *bindex = new CBlockIndex(block);
|
||||||
// Check timestamp
|
// Check timestamp
|
||||||
if (block.GetBlockTime() > GetAdjustedTime() + 60)
|
if (block.GetBlockTime() > GetAdjustedTime() + 60)
|
||||||
return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),REJECT_INVALID, "time-too-new");
|
return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),REJECT_INVALID, "time-too-new");
|
||||||
nBits = block.nBits;
|
nBits = block.nBits;
|
||||||
if ( bindex != 0 && (bindex->nHeight < NOTARIZED_HEIGHT || (bindex->nHeight == NOTARIZED_HEIGHT && NOTARIZED_HASH != bindex->GetBlockHash())) )
|
//if ( bindex != 0 && (bindex->nHeight < NOTARIZED_HEIGHT || (bindex->nHeight == NOTARIZED_HEIGHT && NOTARIZED_HASH != bindex->GetBlockHash())) )
|
||||||
return(false);
|
// return(false);
|
||||||
if ( (retval= komodo_blockhdrcheck(&block,&nBits)) == 0 )
|
if ( (retval= komodo_blockhdrcheck(&block,&nBits)) == 0 )
|
||||||
{
|
{
|
||||||
// Check Equihash solution is valid
|
// Check Equihash solution is valid
|
||||||
|
|||||||
Reference in New Issue
Block a user