Skip to content

Commit

Permalink
updated bignum to support openssl 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
djm34 committed Dec 9, 2018
1 parent 0ad0f03 commit 30de18e
Show file tree
Hide file tree
Showing 7 changed files with 731 additions and 135 deletions.
9 changes: 8 additions & 1 deletion bignum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
#include <stdio.h>

#include "uint256.h"

#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#include "compat/bignum_ssl10.hpp"
#else
#include "bignum.hpp"
#endif

#include "miner.h" // hex2bin

Expand Down Expand Up @@ -74,6 +80,7 @@ extern "C" void bn_store_hash_target_ratio(uint32_t* hash, uint32_t* target, str
{
// only if the option is enabled (to reduce cpu usage)
if (!opt_showdiff) return;
if (nonce < 0 || nonce >= MAX_NONCES) return;

work->shareratio[nonce] = bn_hash_target_ratio(hash, target);
work->sharediff[nonce] = work->targetdiff * work->shareratio[nonce];
Expand All @@ -88,6 +95,6 @@ extern "C" void bn_set_target_ratio(struct work* work, uint32_t* hash, int nonce
// compat (only store single nonce share diff per work)
extern "C" void work_set_target_ratio(struct work* work, uint32_t* hash)
{
bn_store_hash_target_ratio(hash, work->target, work, 0);
bn_store_hash_target_ratio(hash, work->target, work, work->submit_nonce_id);
}

Loading

0 comments on commit 30de18e

Please sign in to comment.