Test
This commit is contained in:
22
src/main.cpp
22
src/main.cpp
@@ -3773,6 +3773,10 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
|
|||||||
{
|
{
|
||||||
uint8_t pubkey33[33]; uint256 hash;
|
uint8_t pubkey33[33]; uint256 hash;
|
||||||
// These are checks that are independent of context.
|
// These are checks that are independent of context.
|
||||||
|
hash = block.GetHash();
|
||||||
|
for (z=31; z>=0; z--)
|
||||||
|
fprintf(stderr,"%02x",((uint8_t *)&hash)[z]);
|
||||||
|
fprintf(stderr," CheckBlock ht.%d\n",height);
|
||||||
|
|
||||||
// Check that the header is valid (particularly PoW). This is mostly
|
// Check that the header is valid (particularly PoW). This is mostly
|
||||||
// redundant with the call in AcceptBlockHeader.
|
// redundant with the call in AcceptBlockHeader.
|
||||||
@@ -4152,23 +4156,39 @@ bool TestBlockValidity(CValidationState &state, const CBlock& block, CBlockIndex
|
|||||||
indexDummy.nHeight = pindexPrev->nHeight + 1;
|
indexDummy.nHeight = pindexPrev->nHeight + 1;
|
||||||
// JoinSplit proofs are verified in ConnectBlock
|
// JoinSplit proofs are verified in ConnectBlock
|
||||||
auto verifier = libzcash::ProofVerifier::Disabled();
|
auto verifier = libzcash::ProofVerifier::Disabled();
|
||||||
|
uint256 h;
|
||||||
|
h = block.GetHash();
|
||||||
|
for (z=31; z>=16; z--)
|
||||||
|
fprintf(stderr,"%02x",((uint8_t *)&h)[z]);
|
||||||
|
fprintf(stderr," test hash\n");
|
||||||
// NOTE: CheckBlockHeader is called by CheckBlock
|
// NOTE: CheckBlockHeader is called by CheckBlock
|
||||||
if (!ContextualCheckBlockHeader(block, state, pindexPrev))
|
if (!ContextualCheckBlockHeader(block, state, pindexPrev))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"TestBlockValidity failure A checkPOW.%d\n",fCheckPOW);
|
fprintf(stderr,"TestBlockValidity failure A checkPOW.%d\n",fCheckPOW);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
h = block.GetHash();
|
||||||
|
for (z=31; z>=16; z--)
|
||||||
|
fprintf(stderr,"%02x",((uint8_t *)&h)[z]);
|
||||||
|
fprintf(stderr," test hash2\n");
|
||||||
if (!CheckBlock(indexDummy.nHeight,0,block, state, verifier, fCheckPOW, fCheckMerkleRoot))
|
if (!CheckBlock(indexDummy.nHeight,0,block, state, verifier, fCheckPOW, fCheckMerkleRoot))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"TestBlockValidity failure B checkPOW.%d\n",fCheckPOW);
|
fprintf(stderr,"TestBlockValidity failure B checkPOW.%d\n",fCheckPOW);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
h = block.GetHash();
|
||||||
|
for (z=31; z>=16; z--)
|
||||||
|
fprintf(stderr,"%02x",((uint8_t *)&h)[z]);
|
||||||
|
fprintf(stderr," test hash3\n");
|
||||||
if (!ContextualCheckBlock(block, state, pindexPrev))
|
if (!ContextualCheckBlock(block, state, pindexPrev))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"TestBlockValidity failure C checkPOW.%d\n",fCheckPOW);
|
fprintf(stderr,"TestBlockValidity failure C checkPOW.%d\n",fCheckPOW);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
h = block.GetHash();
|
||||||
|
for (z=31; z>=16; z--)
|
||||||
|
fprintf(stderr,"%02x",((uint8_t *)&h)[z]);
|
||||||
|
fprintf(stderr," test hash4\n");
|
||||||
if (!ConnectBlock(block, state, &indexDummy, viewNew, true,fCheckPOW))
|
if (!ConnectBlock(block, state, &indexDummy, viewNew, true,fCheckPOW))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"TestBlockValidity failure D checkPOW.%d\n",fCheckPOW);
|
fprintf(stderr,"TestBlockValidity failure D checkPOW.%d\n",fCheckPOW);
|
||||||
|
|||||||
@@ -1080,7 +1080,7 @@ void static BitcoinMiner()
|
|||||||
// Update nNonce and nTime
|
// Update nNonce and nTime
|
||||||
pblock->nNonce = ArithToUint256(UintToArith256(pblock->nNonce) + 1);
|
pblock->nNonce = ArithToUint256(UintToArith256(pblock->nNonce) + 1);
|
||||||
pblock->nBits = savebits;
|
pblock->nBits = savebits;
|
||||||
if ( NOTARY_PUBKEY33[0] == 0 )
|
/*if ( NOTARY_PUBKEY33[0] == 0 )
|
||||||
{
|
{
|
||||||
int32_t percPoS;
|
int32_t percPoS;
|
||||||
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);
|
UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);
|
||||||
@@ -1090,7 +1090,7 @@ void static BitcoinMiner()
|
|||||||
HASHTarget.SetCompact(pblock->nBits);
|
HASHTarget.SetCompact(pblock->nBits);
|
||||||
HASHTarget_POW = komodo_PoWtarget(&percPoS,HASHTarget,Mining_height,ASSETCHAINS_STAKED);
|
HASHTarget_POW = komodo_PoWtarget(&percPoS,HASHTarget,Mining_height,ASSETCHAINS_STAKED);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user