31 lines
593 B
C
31 lines
593 B
C
#ifndef MINER_H
|
|
#define MINER_H
|
|
|
|
#include <stdatomic.h>
|
|
#include <stdint.h>
|
|
|
|
typedef void (*mine_status_cb)(long long attempts, double hashrate_hz, void *ctx);
|
|
|
|
typedef struct {
|
|
int found;
|
|
uint32_t nonce;
|
|
double hashrate_hz;
|
|
long long attempts;
|
|
uint8_t header[80];
|
|
uint8_t digest[32];
|
|
} MineResult;
|
|
|
|
int mine_block(
|
|
uint8_t header_76[76],
|
|
const char *target_hex,
|
|
const char *nonce_mode,
|
|
uint32_t batch_size,
|
|
int timestamp_update_interval,
|
|
atomic_int *stop_flag,
|
|
mine_status_cb status_cb,
|
|
void *status_ctx,
|
|
MineResult *out
|
|
);
|
|
|
|
#endif
|