This commit is contained in:
jl777
2018-07-23 20:29:33 -11:00
parent 562852ab08
commit 2a6a442a4e
2 changed files with 17 additions and 17 deletions

View File

@@ -1607,25 +1607,25 @@ bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlo
{ {
// need a GetTransaction without lock so the validation code for assets can run without deadlock // need a GetTransaction without lock so the validation code for assets can run without deadlock
{ {
fprintf(stderr,"check mempool\n"); //fprintf(stderr,"check mempool\n");
if (mempool.lookup(hash, txOut)) if (mempool.lookup(hash, txOut))
{ {
fprintf(stderr,"found in mempool\n"); //fprintf(stderr,"found in mempool\n");
return true; return true;
} }
} }
fprintf(stderr,"check disk\n"); //fprintf(stderr,"check disk\n");
if (fTxIndex) { if (fTxIndex) {
CDiskTxPos postx; CDiskTxPos postx;
fprintf(stderr,"ReadTxIndex\n"); //fprintf(stderr,"ReadTxIndex\n");
if (pblocktree->ReadTxIndex(hash, postx)) { if (pblocktree->ReadTxIndex(hash, postx)) {
fprintf(stderr,"OpenBlockFile\n"); //fprintf(stderr,"OpenBlockFile\n");
CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION); CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION);
if (file.IsNull()) if (file.IsNull())
return error("%s: OpenBlockFile failed", __func__); return error("%s: OpenBlockFile failed", __func__);
CBlockHeader header; CBlockHeader header;
fprintf(stderr,"seek and read\n"); //fprintf(stderr,"seek and read\n");
try { try {
file >> header; file >> header;
fseek(file.Get(), postx.nTxOffset, SEEK_CUR); fseek(file.Get(), postx.nTxOffset, SEEK_CUR);
@@ -1636,11 +1636,11 @@ bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlo
hashBlock = header.GetHash(); hashBlock = header.GetHash();
if (txOut.GetHash() != hash) if (txOut.GetHash() != hash)
return error("%s: txid mismatch", __func__); return error("%s: txid mismatch", __func__);
fprintf(stderr,"found on disk\n"); //fprintf(stderr,"found on disk\n");
return true; return true;
} }
} }
fprintf(stderr,"not found\n"); //fprintf(stderr,"not found\n");
return false; return false;
} }

View File

@@ -126,7 +126,7 @@ int32_t komodo_notaryvin(CMutableTransaction &txNew,uint8_t *notarypub33);
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount) CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount)
{ {
uint64_t deposits; int32_t isrealtime,kmdheight; uint32_t blocktime; const CChainParams& chainparams = Params(); uint64_t deposits; int32_t isrealtime,kmdheight; uint32_t blocktime; const CChainParams& chainparams = Params();
fprintf(stderr,"create new block\n"); //fprintf(stderr,"create new block\n");
// Create new block // Create new block
if ( gpucount < 0 ) if ( gpucount < 0 )
gpucount = KOMODO_MAXGPUCOUNT; gpucount = KOMODO_MAXGPUCOUNT;
@@ -497,8 +497,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount)
if ( pindexPrev != 0 && ASSETCHAINS_STAKED == 0 ) if ( pindexPrev != 0 && ASSETCHAINS_STAKED == 0 )
{ {
CValidationState state; CValidationState state;
fprintf(stderr,"check validity\n"); //fprintf(stderr,"check validity\n");
if ( !TestBlockValidity(state, *pblock, pindexPrev, false, false)) if ( !TestBlockValidity(state, *pblock, pindexPrev, false, false)) // invokes CC checks
{ {
//static uint32_t counter; //static uint32_t counter;
//if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 ) //if ( counter++ < 100 && ASSETCHAINS_STAKED == 0 )
@@ -506,9 +506,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount)
fprintf(stderr,"invalid\n"); fprintf(stderr,"invalid\n");
return(0); return(0);
} }
fprintf(stderr,"valid\n"); //fprintf(stderr,"valid\n");
} }
fprintf(stderr,"done new block\n"); //fprintf(stderr,"done new block\n");
return pblocktemplate.release(); return pblocktemplate.release();
} }
@@ -792,7 +792,7 @@ void static BitcoinMiner()
} }
if ( ASSETCHAINS_SYMBOL[0] != 0 && ASSETCHAINS_STAKED == 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 && ASSETCHAINS_STAKED == 0 )
{ {
fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height); //fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height);
//sleep(3); //sleep(3);
} }
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
@@ -808,7 +808,7 @@ void static BitcoinMiner()
sleep(1); sleep(1);
continue; continue;
} }
fprintf(stderr,"get template\n"); //fprintf(stderr,"get template\n");
unique_ptr<CBlockTemplate> pblocktemplate(ptr); unique_ptr<CBlockTemplate> pblocktemplate(ptr);
if (!pblocktemplate.get()) if (!pblocktemplate.get())
{ {
@@ -836,7 +836,7 @@ void static BitcoinMiner()
} }
} }
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
fprintf(stderr,"Running KomodoMiner.%s with %u transactions in block\n",solver.c_str(),(int32_t)pblock->vtx.size()); //fprintf(stderr,"Running KomodoMiner.%s with %u transactions in block\n",solver.c_str(),(int32_t)pblock->vtx.size());
LogPrintf("Running KomodoMiner.%s with %u transactions in block (%u bytes)\n",solver.c_str(),pblock->vtx.size(),::GetSerializeSize(*pblock,SER_NETWORK,PROTOCOL_VERSION)); LogPrintf("Running KomodoMiner.%s with %u transactions in block (%u bytes)\n",solver.c_str(),pblock->vtx.size(),::GetSerializeSize(*pblock,SER_NETWORK,PROTOCOL_VERSION));
// //
// Search // Search
@@ -917,7 +917,7 @@ void static BitcoinMiner()
sleep(10); sleep(10);
break; break;
}*/ }*/
fprintf(stderr,"top of while\n"); //fprintf(stderr,"top of while\n");
// Hash state // Hash state
KOMODO_CHOSEN_ONE = 0; KOMODO_CHOSEN_ONE = 0;
crypto_generichash_blake2b_state state; crypto_generichash_blake2b_state state;