1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-09 06:18:06 +00:00
sgminer/algorithm.h
Noel Maersk c6a27709f8 core: use global algorithm structure instead of opt_nfactor.
Also squashed:

config: add log messages to set_algo() and set_nfactor().

algorithm: use set_algorithm_nfactor() when setting default nfactor in set_algorithm().

Otherwise algorithm->n defaults to 0.

P.S. Did I already mention how this could have been C++?..
2014-03-07 02:27:06 +02:00

22 lines
615 B
C

#ifndef ALGORITHM_H
#define ALGORITHM_H
#include <inttypes.h>
/* Describes the Scrypt parameters and hashing functions used to mine
* a specific coin.
*/
typedef struct _algorithm_t {
char name[20]; /* Human-readable identifier */
uint32_t n; /* N (CPU/Memory tradeoff parameter) */
uint8_t nfactor; /* Factor of N above (n = 2^nfactor) */
} algorithm_t;
/* Set default parameters based on name. */
void set_algorithm(algorithm_t* algo, const char* name);
/* Set to specific N factor. */
void set_algorithm_nfactor(algorithm_t* algo, const uint8_t nfactor);
#endif /* ALGORITHM_H */