aboutsummaryrefslogtreecommitdiff
path: root/miner.h
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2011-02-03 00:46:55 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-02-03 00:46:55 -0500
commit714c0fd7c90cdb11742f7f2c91a65357a7bf5d5a (patch)
treef96729029d4411e1f6a5b2aa484bbf7008ba09dd /miner.h
parentc68ffb30dd17b32f69665af18b72687875770972 (diff)
Continue scanhash, even if high 32 bits are zero.
Previously, we would stop the scan if the high 32 bits of the hash were zero, as a quick shortcut for testing the full hash. If this quick test succeeded, we would pass the work to the server for full validation. Change this logic to perform full validation inside minerd, so that work may be resumed more quickly if hash > target.
Diffstat (limited to 'miner.h')
-rw-r--r--miner.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/miner.h b/miner.h
index 49bc07d..539b5d6 100644
--- a/miner.h
+++ b/miner.h
@@ -52,24 +52,29 @@ extern bool hex2bin(unsigned char *p, const char *hexstr, size_t len);
extern unsigned int ScanHash_4WaySSE2(const unsigned char *pmidstate,
unsigned char *pdata, unsigned char *phash1, unsigned char *phash,
+ const unsigned char *ptarget,
uint32_t max_nonce, unsigned long *nHashesDone);
extern bool scanhash_via(unsigned char *data_inout,
+ const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done);
extern bool scanhash_c(const unsigned char *midstate, unsigned char *data,
unsigned char *hash1, unsigned char *hash,
+ const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done);
extern bool scanhash_cryptopp(const unsigned char *midstate,unsigned char *data,
unsigned char *hash1, unsigned char *hash,
+ const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done);
extern bool scanhash_asm32(const unsigned char *midstate,unsigned char *data,
unsigned char *hash1, unsigned char *hash,
+ const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done);
extern int
timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y);
-extern void print_pow(const unsigned char *hash);
+extern bool fulltest(const unsigned char *hash, const unsigned char *target);
#endif /* __MINER_H__ */