This commit is contained in:
jl777
2016-11-14 15:00:25 -03:00
parent 7d51d97389
commit 2e500f5048
7 changed files with 33 additions and 32 deletions

View File

@@ -479,7 +479,7 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese
{
LOCK(cs_main);
if (pblock->hashPrevBlock != chainActive.Tip()->GetBlockHash())
return error("ZcashMiner: generated block is stale");
return error("KomodoMiner: generated block is stale");
}
// Remove key from key pool
@@ -495,7 +495,7 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese
// Process this block the same as if we had received it from another node
CValidationState state;
if (!ProcessNewBlock(chainActive.Tip()->nHeight+1,state, NULL, pblock, true, NULL))
return error("ZcashMiner: ProcessNewBlock, block not accepted");
return error("KomodoMiner: ProcessNewBlock, block not accepted");
minedBlocks.increment();
@@ -506,9 +506,9 @@ int32_t komodo_baseid(char *origbase);
void static BitcoinMiner(CWallet *pwallet)
{
LogPrintf("ZcashMiner started\n");
LogPrintf("KomodoMiner started\n");
SetThreadPriority(THREAD_PRIORITY_LOWEST);
RenameThread("zcash-miner");
RenameThread("komodo-miner");
const CChainParams& chainparams = Params();
// Each thread has its own key and counter
@@ -583,12 +583,12 @@ void static BitcoinMiner(CWallet *pwallet)
unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
if (!pblocktemplate.get())
{
LogPrintf("Error in ZcashMiner: Keypool ran out, please call keypoolrefill before restarting the mining thread\n");
LogPrintf("Error in KomodoMiner: Keypool ran out, please call keypoolrefill before restarting the mining thread\n");
return;
}
CBlock *pblock = &pblocktemplate->block;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
LogPrintf("Running ZcashMiner.%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
//
@@ -641,7 +641,7 @@ void static BitcoinMiner(CWallet *pwallet)
}
// Found a solution
SetThreadPriority(THREAD_PRIORITY_NORMAL);
LogPrintf("ZcashMiner:\n");
LogPrintf("KomodoMiner:\n");
LogPrintf("proof-of-work found \n hash: %s \ntarget: %s\n", pblock->GetHash().GetHex(), hashTarget.GetHex());
if (ProcessBlockFound(pblock, *pwallet, reservekey)) {
// Ignore chain updates caused by us
@@ -755,12 +755,12 @@ void static BitcoinMiner(CWallet *pwallet)
}
catch (const boost::thread_interrupted&)
{
LogPrintf("ZcashMiner terminated\n");
LogPrintf("KomodoMiner terminated\n");
throw;
}
catch (const std::runtime_error &e)
{
LogPrintf("ZcashMiner runtime error: %s\n", e.what());
LogPrintf("KomodoMiner runtime error: %s\n", e.what());
return;
}
c.disconnect();