Skip to content

Commit

Permalink
cryptonight: handle rpc 2.0 pools and clean the crypto-rpc-code
Browse files Browse the repository at this point in the history
never had the time before to work on this different protocol...
  • Loading branch information
tpruvot committed Jul 15, 2015
1 parent c4c15b8 commit c6cd77c
Show file tree
Hide file tree
Showing 5 changed files with 408 additions and 360 deletions.
8 changes: 7 additions & 1 deletion algo/cryptonight.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ typedef __uint128_t uint128_t;

#define MEMORY (1 << 21) /* 2 MiB */
#define ITER (1 << 20)

// Lite
//#define MEMORY (1 << 20)
//#define ITER (1 << 19)

#define AES_BLOCK_SIZE 16
#define AES_KEY_SIZE 32 /*16*/
#define INIT_SIZE_BLK 8
Expand Down Expand Up @@ -298,7 +303,8 @@ void cryptonight_hash_ctx_aes_ni(void* output, const void* input, int len, struc
}

int scanhash_cryptonight(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
uint32_t max_nonce, uint64_t *hashes_done) {
uint32_t max_nonce, uint64_t *hashes_done)
{
uint32_t *nonceptr = (uint32_t*) (((char*)pdata) + 39);
uint32_t n = *nonceptr - 1;
const uint32_t first_nonce = n + 1;
Expand Down
2 changes: 0 additions & 2 deletions api.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ static char *buffer = NULL;
static time_t startup = 0;
static int bye = 0;

extern int opt_n_threads;
extern char *opt_api_allow;
extern int opt_api_listen; /* port */
extern int opt_api_remote;
extern double *thr_hashrates;
extern uint64_t global_hashrate;
extern uint32_t accepted_count;
extern uint32_t rejected_count;
Expand Down
Loading

0 comments on commit c6cd77c

Please sign in to comment.