Test
This commit is contained in:
@@ -54,6 +54,7 @@ using namespace std;
|
|||||||
CCriticalSection cs_main;
|
CCriticalSection cs_main;
|
||||||
extern uint8_t NOTARY_PUBKEY33[33];
|
extern uint8_t NOTARY_PUBKEY33[33];
|
||||||
extern int32_t KOMODO_LOADINGBLOCKS;
|
extern int32_t KOMODO_LOADINGBLOCKS;
|
||||||
|
void komodo_block2pubkey33(uint8_t *pubkey33,CBlock& block);
|
||||||
|
|
||||||
BlockMap mapBlockIndex;
|
BlockMap mapBlockIndex;
|
||||||
CChain chainActive;
|
CChain chainActive;
|
||||||
@@ -1610,7 +1611,7 @@ bool ReadBlockFromDisk(int32_t height,CBlock& block, const CDiskBlockPos& pos)
|
|||||||
return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString());
|
return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString());
|
||||||
}
|
}
|
||||||
// Check the header
|
// Check the header
|
||||||
//komodo_block2pubkey33(pubkey33,block);
|
komodo_block2pubkey33(pubkey33,block);
|
||||||
if (!(CheckEquihashSolution(&block, Params()) && CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus())))
|
if (!(CheckEquihashSolution(&block, Params()) && CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus())))
|
||||||
{
|
{
|
||||||
int32_t i; for (i=0; i<33; i++)
|
int32_t i; for (i=0; i<33; i++)
|
||||||
@@ -3527,8 +3528,9 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
|
|||||||
// redundant with the call in AcceptBlockHeader.
|
// redundant with the call in AcceptBlockHeader.
|
||||||
if (!CheckBlockHeader(height,pindex,block,state,fCheckPOW))
|
if (!CheckBlockHeader(height,pindex,block,state,fCheckPOW))
|
||||||
return false;
|
return false;
|
||||||
komodo_index2pubkey33(pubkey33,pindex,height);
|
//komodo_index2pubkey33(pubkey33,pindex,height);
|
||||||
if ( fCheckPOW && !CheckProofOfWork(height,pubkey33,blockhdr.GetHash(), block.nBits, Params().GetConsensus()) )
|
komodo_block2pubkey33(pubkey33,block);
|
||||||
|
if ( fCheckPOW && !CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus()) )
|
||||||
return state.DoS(50, error("CheckBlock(): proof of work failed"),REJECT_INVALID, "high-hash");
|
return state.DoS(50, error("CheckBlock(): proof of work failed"),REJECT_INVALID, "high-hash");
|
||||||
|
|
||||||
// Check the merkle root.
|
// Check the merkle root.
|
||||||
|
|||||||
Reference in New Issue
Block a user