summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/globalStates.hpp
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-17 21:30:29 +0100
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-10-22 13:15:18 +0100
commitd3c5911f8e486ac0d08c5160f6d9bd934c697b91 (patch)
tree66441e722f2bbc8b99e6ba597b07bd6bb38aec59 /xmrstak/backend/globalStates.hpp
parent27b839b8d2275c0e78a07cb03d27afb96ed6c7b9 (diff)
downloadxmr-stak-d3c5911f8e486ac0d08c5160f6d9bd934c697b91.zip
xmr-stak-d3c5911f8e486ac0d08c5160f6d9bd934c697b91.tar.gz
move nicehash check into nonce calc
Diffstat (limited to 'xmrstak/backend/globalStates.hpp')
-rw-r--r--xmrstak/backend/globalStates.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/xmrstak/backend/globalStates.hpp b/xmrstak/backend/globalStates.hpp
index 855488d..50dc753 100644
--- a/xmrstak/backend/globalStates.hpp
+++ b/xmrstak/backend/globalStates.hpp
@@ -33,11 +33,14 @@ struct globalStates
//pool_data is in-out winapi style
void switch_work(miner_work& pWork, pool_data& dat);
- inline uint32_t calc_start_nonce(uint32_t nicehash_nonce, uint32_t reserve_count)
+ inline void calc_start_nonce(uint32_t& nonce, bool use_nicehash, uint32_t reserve_count)
{
- uint32_t debug_nonce = nicehash_nonce | iGlobalNonce.fetch_add(reserve_count);
- printer::inst()->print_msg(L1, "DEBUG: start_nonce assigned nh: %.8x rc: %.8x nonce: %.8x", nicehash_nonce, reserve_count, debug_nonce);
- return debug_nonce;
+ if(use_nicehash)
+ nonce = (nonce & 0xFF000000) | iGlobalNonce.fetch_add(reserve_count);
+ else
+ nonce = iGlobalNonce.fetch_add(reserve_count);
+
+ printer::inst()->print_msg(L1, "DEBUG: start_nonce assigned rc: %.8x nonce: %.8x", reserve_count, nonce);
}
miner_work oGlobalWork;
OpenPOWER on IntegriCloud