From e5d9a70246db09bf7ed0b3e95317c115cf4d9e90 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 19 Apr 2018 14:57:51 +0300 Subject: [PATCH] Test --- src/main.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 34c39424d..e7e4a9754 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3771,7 +3771,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat libzcash::ProofVerifier& verifier, bool fCheckPOW, bool fCheckMerkleRoot) { - uint8_t pubkey33[33]; + uint8_t pubkey33[33]; uint256 hash; // These are checks that are independent of context. // Check that the header is valid (particularly PoW). This is mostly @@ -3783,14 +3783,18 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat } if ( fCheckPOW ) { - //if ( !CheckEquihashSolution(&block, Params()) ) + int32_t z; + //if ( !CheckEquihashSolution(&block, Params()) ) // return state.DoS(100, error("CheckBlock: Equihash solution invalid"),REJECT_INVALID, "invalid-solution"); + hash = block.GetHash(); + for (z=31; z>=0; z--) + fprintf(stderr,"%02x",((uint8_t *)&hash)[z]); + fprintf(stderr," check hash ht.%d\n",height); komodo_block2pubkey33(pubkey33,(CBlock *)&block); - if ( !CheckProofOfWork(height,pubkey33,block.GetHash(),block.nBits,Params().GetConsensus(),block.nTime) ) + if ( !CheckProofOfWork(height,pubkey33,hash,block.nBits,Params().GetConsensus(),block.nTime) ) { - int32_t z; uint256 h = block.GetHash(); for (z=31; z>=0; z--) - fprintf(stderr,"%02x",((uint8_t *)&h)[z]); + fprintf(stderr,"%02x",((uint8_t *)&hash)[z]); fprintf(stderr," failed hash ht.%d\n",height); return state.DoS(50, error("CheckBlock: proof of work failed"),REJECT_INVALID, "high-hash"); }