test
This commit is contained in:
@@ -503,6 +503,7 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
//
|
//
|
||||||
// Create new block
|
// Create new block
|
||||||
//
|
//
|
||||||
|
uint32_t starttime = (uint32_t)time(NULL);
|
||||||
unsigned int nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
|
unsigned int nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
|
||||||
CBlockIndex* pindexPrev = chainActive.Tip();
|
CBlockIndex* pindexPrev = chainActive.Tip();
|
||||||
|
|
||||||
@@ -521,7 +522,6 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
// Search
|
// Search
|
||||||
//
|
//
|
||||||
int32_t notaryid; uint32_t savebits; int64_t nStart = GetTime();
|
int32_t notaryid; uint32_t savebits; int64_t nStart = GetTime();
|
||||||
uint32_t starttime = (uint32_t)time(NULL);
|
|
||||||
savebits = pblock->nBits;
|
savebits = pblock->nBits;
|
||||||
if ( komodo_chosennotary(¬aryid,pindexPrev->nHeight+1,NOTARY_PUBKEY33) > 0 )
|
if ( komodo_chosennotary(¬aryid,pindexPrev->nHeight+1,NOTARY_PUBKEY33) > 0 )
|
||||||
{
|
{
|
||||||
@@ -565,22 +565,17 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
if (UintToArith256(pblock->GetHash()) > hashTarget) {
|
if (UintToArith256(pblock->GetHash()) > hashTarget) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ( time(NULL) < starttime+50 )
|
||||||
|
sleep(starttime+50-time(NULL));
|
||||||
|
|
||||||
// Found a solution
|
// Found a solution
|
||||||
SetThreadPriority(THREAD_PRIORITY_NORMAL);
|
SetThreadPriority(THREAD_PRIORITY_NORMAL);
|
||||||
LogPrintf("ZcashMiner:\n");
|
LogPrintf("ZcashMiner:\n");
|
||||||
LogPrintf("proof-of-work found \n hash: %s \ntarget: %s\n", pblock->GetHash().GetHex(), hashTarget.GetHex());
|
LogPrintf("proof-of-work found \n hash: %s \ntarget: %s\n", pblock->GetHash().GetHex(), hashTarget.GetHex());
|
||||||
if ( pblock->nBits == KOMODO_MINDIFF_NBITS )
|
|
||||||
{
|
|
||||||
while ( (uint32_t)time(NULL) < starttime+50 )
|
|
||||||
{
|
|
||||||
fprintf(stderr,"%u: wait until %u\n",(uint32_t)time(NULL),starttime+50);
|
|
||||||
sleep(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ProcessBlockFound(pblock, *pwallet, reservekey)) {
|
if (ProcessBlockFound(pblock, *pwallet, reservekey)) {
|
||||||
// Ignore chain updates caused by us
|
// Ignore chain updates caused by us
|
||||||
std::lock_guard<std::mutex> lock{m_cs};
|
std::lock_guard<std::mutex> lock{m_cs};
|
||||||
cancelSolver = false;
|
cancelSolver = false;
|
||||||
}
|
}
|
||||||
SetThreadPriority(THREAD_PRIORITY_LOWEST);
|
SetThreadPriority(THREAD_PRIORITY_LOWEST);
|
||||||
|
|||||||
Reference in New Issue
Block a user