mirror of
https://github.com/PurpleI2P/i2pd-tools
synced 2025-02-07 04:04:14 +00:00
~
This commit is contained in:
parent
7673f8cab9
commit
8d47f128eb
@ -74,7 +74,7 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
static size_t ByteStreamToBase32 (const uint8_t * inBuf, size_t len, char * outBuf, size_t outLen)
|
||||
static inline size_t ByteStreamToBase32 (const uint8_t * inBuf, size_t len, char * outBuf, size_t outLen)
|
||||
{
|
||||
size_t ret = 0, pos = 1;
|
||||
int bits = 8, tmp = inBuf[0];
|
||||
@ -169,28 +169,29 @@ while(throughput-- and !found){
|
||||
// apply last block
|
||||
TransformBlock (state1, lastW);
|
||||
// get final hash
|
||||
for (int j = 0; j < 8; j++)
|
||||
for (int j = 8; j--;)
|
||||
hash[j] = htobe32 (state1[j]);
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
ByteStreamToBase32 ((uint8_t*)hash, 32, addr, len);
|
||||
// std::cout << addr << std::endl;
|
||||
if( !NotThat(addr,prefix) ){
|
||||
ByteStreamToBase32 ((uint8_t*)hash, 32, addr, 52);
|
||||
std::cout << "Address found " << addr << " in " << id_thread << std::endl;
|
||||
found=true;
|
||||
FoundNonce=*nonce;
|
||||
//free(hash);
|
||||
//free(b);
|
||||
free(hash);
|
||||
free(b);
|
||||
return true;
|
||||
}
|
||||
|
||||
(*nonce)++;
|
||||
hashescounter++;
|
||||
if (found){
|
||||
//free(hash);
|
||||
//free(b);
|
||||
free(hash);
|
||||
free(b);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user