Small changes to ThreadStakeMiner()
This commit is contained in:
@@ -608,7 +608,7 @@ void ThreadStakeMiner(CWallet *pwallet, const CChainParams& chainparams)
|
|||||||
LogPrintf("Staking started\n");
|
LogPrintf("Staking started\n");
|
||||||
|
|
||||||
// Make this thread recognisable as the mining thread
|
// Make this thread recognisable as the mining thread
|
||||||
RenameThread("BlackcoinMiner");
|
RenameThread("blackcoin-miner");
|
||||||
|
|
||||||
CReserveKey reservekey(pwallet);
|
CReserveKey reservekey(pwallet);
|
||||||
|
|
||||||
@@ -623,7 +623,7 @@ void ThreadStakeMiner(CWallet *pwallet, const CChainParams& chainparams)
|
|||||||
while (pwallet->IsLocked())
|
while (pwallet->IsLocked())
|
||||||
{
|
{
|
||||||
nLastCoinStakeSearchInterval = 0;
|
nLastCoinStakeSearchInterval = 0;
|
||||||
MilliSleep(1000);
|
MilliSleep(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!regtestMode) {
|
if (!regtestMode) {
|
||||||
@@ -658,14 +658,16 @@ void ThreadStakeMiner(CWallet *pwallet, const CChainParams& chainparams)
|
|||||||
// Trying to sign a block
|
// Trying to sign a block
|
||||||
if (SignBlock(*pblock, *pwallet, nFees))
|
if (SignBlock(*pblock, *pwallet, nFees))
|
||||||
{
|
{
|
||||||
SetThreadPriority(THREAD_PRIORITY_NORMAL);
|
// increase priority
|
||||||
|
SetThreadPriority(THREAD_PRIORITY_ABOVE_NORMAL);
|
||||||
|
// Sign the full block
|
||||||
CheckStake(pblock, *pwallet, chainparams);
|
CheckStake(pblock, *pwallet, chainparams);
|
||||||
|
// return back to low priority
|
||||||
SetThreadPriority(THREAD_PRIORITY_LOWEST);
|
SetThreadPriority(THREAD_PRIORITY_LOWEST);
|
||||||
MilliSleep(500);
|
MilliSleep(500);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
MilliSleep(nMinerSleep);
|
|
||||||
}
|
}
|
||||||
|
MilliSleep(nMinerSleep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user