Merge pull request #596 from rnicoll/1.8-dev-unused
Removed unused ScanHash_CryptoPP() method
This commit is contained in:
commit
6196efe873
|
@ -423,41 +423,6 @@ void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash
|
|||
double dHashesPerSec = 0.0;
|
||||
int64_t nHPSTimerStart = 0;
|
||||
|
||||
//
|
||||
// ScanHash scans nonces looking for a hash with at least some zero bits.
|
||||
// It operates on big endian data. Caller does the byte reversing.
|
||||
// All input buffers are 16-byte aligned. nNonce is usually preserved
|
||||
// between calls, but periodically or if nNonce is 0xffff0000 or above,
|
||||
// the block is rebuilt and nNonce starts over at zero.
|
||||
//
|
||||
unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)
|
||||
{
|
||||
unsigned int& nNonce = *(unsigned int*)(pdata + 12);
|
||||
for (;;)
|
||||
{
|
||||
// Crypto++ SHA256
|
||||
// Hash pdata using pmidstate as the starting state into
|
||||
// pre-formatted buffer phash1, then hash phash1 into phash
|
||||
nNonce++;
|
||||
SHA256Transform(phash1, pdata, pmidstate);
|
||||
SHA256Transform(phash, phash1, pSHA256InitState);
|
||||
|
||||
// Return the nonce if the hash has at least some zero bits,
|
||||
// caller will check if it has enough to reach the target
|
||||
if (((unsigned short*)phash)[14] == 0)
|
||||
return nNonce;
|
||||
|
||||
// If nothing found after trying for a while, return -1
|
||||
if ((nNonce & 0xffff) == 0)
|
||||
{
|
||||
nHashesDone = 0xffff+1;
|
||||
return (unsigned int) -1;
|
||||
}
|
||||
if ((nNonce & 0xfff) == 0)
|
||||
boost::this_thread::interruption_point();
|
||||
}
|
||||
}
|
||||
|
||||
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
|
||||
{
|
||||
CPubKey pubkey;
|
||||
|
|
Loading…
Reference in a new issue