It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
#include "scrypt_mine.h"
<...//..>
void static BitcoinMiner(CWallet *pwallet, int thread_id)
{
printf("Miner started\n");
SetThreadPriority(THREAD_PRIORITY_LOWEST);
// Each thread has its own key and counter
CReserveKey reservekey(pwallet);
unsigned int nExtraNonce = 0;
void *scratchbuf = scrypt_buffer_alloc();
while (fGenerateBitcoins)
{
if (AffinityBugWorkaround(ThreadMiner))
return;
if (fShutdown)
return;
while (vNodes.empty() || IsInitialBlockDownload())
{
Sleep(1000);
if (fShutdown)
return;
if (!fGenerateBitcoins)
return;
}
//
// Create new block
//
unsigned int nTransactionsUpdatedLast = nTransactionsUpdated;
CBlockIndex* pindexPrev = pindexBest;
auto_ptrpblock(CreateNewBlock(pwallet));
if (!pblock.get())
return;
IncrementExtraNonce(pblock.get(), pindexPrev, nExtraNonce);
printf("Running Miner with %d transactions in block\n", pblock->vtx.size());
//
// Search
//
uint64_t nStart = GetTime();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
uint32_t max_nonce = 0xffff0000;
block_header res_header;
uint256 result;
loop
{
// Check for stop or if block needs to be rebuilt
if (fShutdown)
return;
if (!fGenerateBitcoins)
return;
if (fLimitProcessors && vnThreadsRunning[3] > nLimitProcessors)
return;
if (vNodes.empty())
break;
bool rc = scanhash_scrypt(
(block_header *)&pblock->nVersion, sizeof(block_header), UINTBEGIN(hashTarget),
scratchbuf, max_nonce, &sStat[thread_id - 1], nStart, pindexPrev,
nTransactionsUpdatedLast, UBEGIN(result), &res_header
);
pblock->nNonce = res_header.nonce;
if (rc)
{
static CCriticalSection cs;
CRITICAL_BLOCK(cs)
{
printf("Thread %d: scan hash result = %i, nonce value = %d, hash = %s, target = %s\n", thread_id, rc, pblock->nNonce, result.ToString().c_str(), hashTarget.ToString().c_str());
// Found a solution
SetThreadPriority(THREAD_PRIORITY_NORMAL);
CheckWork(pblock.get(), *pwalletMain, reservekey);
SetThreadPriority(THREAD_PRIORITY_LOWEST);
}
break;
}
else
if( (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 60) ||
(pindexPrev != pindexBest)
)
break;
// Update nTime every few seconds
pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
}
}
scrypt_buffer_free(scratchbuf);
}
#include "scrypt_mine.h"
<...//..>
/*
uint256 GetHash() const
{
return Hash(BEGIN(nVersion), END(nNonce));
}*/
uint256 GetHash() const
{
uint256 thash;
void * scratchbuff = scrypt_buffer_alloc();
scrypt_hash(CVOIDBEGIN(nVersion), sizeof(block_header), UINTBEGIN(thash), scratchbuff);
scrypt_buffer_free(scratchbuff);
return thash;
}
#define UINTBEGIN(a) ((uint32_t*)&(a))
#define CVOIDBEGIN(a) ((const void*)&(a))