本文整理汇总了C++中CBigNum::getuint1024方法的典型用法代码示例。如果您正苦于以下问题:C++ CBigNum::getuint1024方法的具体用法?C++ CBigNum::getuint1024怎么用?C++ CBigNum::getuint1024使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBigNum
的用法示例。
在下文中一共展示了CBigNum::getuint1024方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetThroughput
void MinerThread::SK1024Miner()
{
SetThreadPriority(GetCurrentThread(), 2);
const int throughput = GetThroughput() == 0 ? 512 * 1 * 512 * 8 : GetThroughput();
loop
{
try
{
/** Don't mine if the Connection Thread is Submitting Block or Receiving New. **/
while(m_bNewBlock || m_bBlockFound || !m_pBLOCK)
Sleep(1);
CBigNum target;
target.SetCompact(m_pBLOCK->GetBits());
if (m_bBenchmark == true)
{
target.SetCompact(0x7e006fff);
//target.SetCompact(0x7e7fffff);
//target.SetCompact(0x7e7fffff);
//target = target / 0x300;
}
while(!m_bNewBlock)
{
uint1024 hash;
unsigned long long hashes=0;
unsigned int * TheData =(unsigned int*) m_pBLOCK->GetData();
uint1024 TheTarget = target.getuint1024();
uint64_t Nonce; //= m_pBLOCK->GetNonce();
bool found = false;
m_clLock.lock();
{
Nonce = m_pBLOCK->GetNonce();
//m_GpuId = 0;
found = scanhash_sk1024(m_GpuId, TheData, TheTarget, Nonce, 512 * 8 * 512 * 40, &hashes, throughput, 128, 128);
if (hashes < 0xffffffffffff)
SetHashes(GetHashes()+hashes);
}
m_clLock.unlock();
if(found)
{
m_bBlockFound = true;
m_clLock.lock();
{
m_pBLOCK->SetNonce(Nonce);
}
m_clLock.unlock();
break;
}
// printf("hashes %d m_unHashes %d gethashes %d\n",hashes,m_unHashes,GetHashes());
/*m_clLock.lock();
{
m_pBLOCK->SetNonce(m_pBLOCK->GetNonce()+hashes);
}
m_clLock.unlock();
*/
if(Nonce >= MAX_THREADS) //max_thread==> max_nonce
{
m_bNewBlock = true;
break;
}
}
}
catch(std::exception& e)
{
printf("ERROR: %s\n", e.what());
}
}
}