Use a completely different function for RandomX mining to minimize potential of equihash consensus bugs
This commit is contained in:
@@ -79,9 +79,14 @@ uint64_t ASSETCHAINS_ENDSUBSIDY[ASSETCHAINS_MAX_ERAS+1],ASSETCHAINS_REWARD[ASSET
|
|||||||
uint8_t ASSETCHAINS_CCDISABLES[256];
|
uint8_t ASSETCHAINS_CCDISABLES[256];
|
||||||
std::vector<std::string> ASSETCHAINS_PRICES,ASSETCHAINS_STOCKS;
|
std::vector<std::string> ASSETCHAINS_PRICES,ASSETCHAINS_STOCKS;
|
||||||
|
|
||||||
|
|
||||||
|
// this is the offset in the ASSETCHAINS_ALGORITHMS array
|
||||||
#define _ASSETCHAINS_EQUIHASH 0
|
#define _ASSETCHAINS_EQUIHASH 0
|
||||||
uint32_t ASSETCHAINS_NUMALGOS = 4;
|
#define _ASSETCHAINS_RANDOMX 1
|
||||||
|
|
||||||
|
uint32_t ASSETCHAINS_NUMALGOS = 4; // there are different variants of equihash with different (N,K)
|
||||||
uint32_t ASSETCHAINS_EQUIHASH = _ASSETCHAINS_EQUIHASH;
|
uint32_t ASSETCHAINS_EQUIHASH = _ASSETCHAINS_EQUIHASH;
|
||||||
|
uint32_t ASSETCHAINS_RANDOMX = _ASSETCHAINS_RANDOMX;
|
||||||
const char *ASSETCHAINS_ALGORITHMS[] = {"equihash", "randomx"};
|
const char *ASSETCHAINS_ALGORITHMS[] = {"equihash", "randomx"};
|
||||||
uint64_t ASSETCHAINS_NONCEMASK[] = {0xffff};
|
uint64_t ASSETCHAINS_NONCEMASK[] = {0xffff};
|
||||||
uint32_t ASSETCHAINS_NONCESHIFT[] = {32};
|
uint32_t ASSETCHAINS_NONCESHIFT[] = {32};
|
||||||
|
|||||||
@@ -1528,11 +1528,17 @@ void static BitcoinMiner()
|
|||||||
|
|
||||||
for (int i = 0; i < nThreads; i++) {
|
for (int i = 0; i < nThreads; i++) {
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
if ( ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH )
|
if ( ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH ) {
|
||||||
minerThreads->create_thread(boost::bind(&BitcoinMiner, pwallet));
|
minerThreads->create_thread(boost::bind(&BitcoinMiner, pwallet));
|
||||||
|
} else if (ASSETCHAINS_ALGO == ASSETCHAINS_RANDOMX ) {
|
||||||
|
minerThreads->create_thread(boost::bind(&RandomXMiner, pwallet));
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH )
|
if (ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH ) {
|
||||||
minerThreads->create_thread(&BitcoinMiner);
|
minerThreads->create_thread(&BitcoinMiner);
|
||||||
|
} else if (ASSETCHAINS_ALGO == ASSETCHAINS_RANDOMX) {
|
||||||
|
minerThreads->create_thread(&RandomXMiner);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user