diff --git a/include/tnn-common.hpp b/include/tnn-common.hpp index 23e0c4d..5b99cdb 100644 --- a/include/tnn-common.hpp +++ b/include/tnn-common.hpp @@ -36,6 +36,8 @@ extern bool ABORT_MINER; static const char *nullArg = "NULL"; static const char* devWorkerName = "tnn-dev"; +extern bool devTurn; + extern std::string workerName; extern std::string workerNameFromWallet; extern bool useLookupMine; diff --git a/src/coins/dummy_miners.cpp b/src/coins/dummy_miners.cpp index 0a47e9e..626cf8e 100644 --- a/src/coins/dummy_miners.cpp +++ b/src/coins/dummy_miners.cpp @@ -37,3 +37,8 @@ blankfunc(mineNexellia); #ifndef TNN_HOOHASH blankfunc(mineHoosat); #endif + +// Hoosat +#ifndef TNN_WALAHASH +blankfunc(mineWaglayla); +#endif diff --git a/src/coins/mine_spectre.cpp b/src/coins/mine_spectre.cpp index 17a68c6..9cdf90a 100644 --- a/src/coins/mine_spectre.cpp +++ b/src/coins/mine_spectre.cpp @@ -119,7 +119,7 @@ void mineSpectre(int tid) // printf("end of job application\n"); while (localJobCounter == jobCounter) { - CHECK_CLOSE; + // CHECK_CLOSE; which = (double)(rand() % 10000); devMine = (devConnected && devHeight > 0 && which < devFee * 100.0); DIFF = devMine ? doubleDiffDev : doubleDiff; diff --git a/src/coins/mine_waglayla.cpp b/src/coins/mine_waglayla.cpp index 99d5b8e..66ee61a 100644 --- a/src/coins/mine_waglayla.cpp +++ b/src/coins/mine_waglayla.cpp @@ -271,10 +271,10 @@ void mineWaglayla(int tid) myJob.at("jobId").as_string().c_str(), // JOB ID std::string(nonceStr.data()).c_str()}}}}; - std::cout << "blob: " << hexStr(&WORK[0], WalaHash::INPUT_SIZE).c_str() << std::endl; + // std::cout << "blob: " << hexStr(&WORK[0], WalaHash::INPUT_SIZE).c_str() << std::endl; // std::cout << "nonce: " << n << std::endl; // std::cout << "extraNonce: " << hexStr(&WORK[WalaHash::INPUT_SIZE - 48], enLen).c_str() << std::endl; - std::cout << "hash: " << hexStr(&usedWorker.scratchData[0], 32) << std::endl; + // std::cout << "hash: " << hexStr(&usedWorker.scratchData[0], 32) << std::endl; // std::vector diffHex; // cmpDiff.print(diffHex, 16); // std::cout << "difficulty (LE): " << std::string(diffHex.data()).c_str() << std::endl; @@ -283,7 +283,7 @@ void mineWaglayla(int tid) // printf("blob: %s\n", foundBlob.c_str()); // printf("hash (BE): %s\n", hexStr(&powHash[0], 32).c_str()); - printf("nonce (Full bytes for injection): %s\n", nonceStr.data()); + // printf("nonce (Full bytes for injection): %s\n", nonceStr.data()); break; } diff --git a/src/core/miner.cpp b/src/core/miner.cpp index 6ebdf72..a5c5351 100644 --- a/src/core/miner.cpp +++ b/src/core/miner.cpp @@ -141,6 +141,7 @@ std::string workerNameFromWallet = ""; bool isConnected = false; bool devConnected = false; +bool devTurn = false; bool beQuiet = false; /* End definitions from tnn-common.hpp */ @@ -612,11 +613,11 @@ int main(int argc, char **argv) if(wallet.find("xel:", 0) != std::string::npos || wallet.find("xet:", 0) != std::string::npos) { symbol = "XEL"; } - if(wallet.find("spectre", 0) != std::string::npos || wallet.find("spectretest", 0)) { + if(wallet.find("spectre", 0) != std::string::npos || wallet.find("spectretest", 0) != std::string::npos) { symbol = "SPR"; protocol = SPECTRE_STRATUM; } - if(wallet.find("astrix", 0) != std::string::npos || wallet.find("astrixtest", 0)) { + if(wallet.find("astrix", 0) != std::string::npos || wallet.find("astrixtest", 0) != std::string::npos) { symbol = "AIX"; protocol = KAS_STRATUM; } @@ -1266,7 +1267,7 @@ void getWork(bool isDev, int algo) case SPECTRE_X: { DAEMONTYPE = ""; - DAEMONPROTOCOL = KAS_STRATUM; + DAEMONPROTOCOL = SPECTRE_STRATUM; HOST = defaultHost[SPECTRE_X]; WORKER = devWorkerName; PORT = devPort[SPECTRE_X]; diff --git a/src/net/kas/net_kas_stratum.cpp b/src/net/kas/net_kas_stratum.cpp index f2293a4..5338751 100644 --- a/src/net/kas/net_kas_stratum.cpp +++ b/src/net/kas/net_kas_stratum.cpp @@ -48,7 +48,7 @@ int handleKasStratumPacket(boost::json::object packet, KasStratum::jobCache *cac isEqual &= comboHeader[i] == cache->header[i]; } - isEqual &= ts != cache->ts; + isEqual &= ts == cache->ts; if (!isEqual) { uint64_t &N = isDev ? nonce0_dev : nonce0; diff --git a/src/net/net.hpp b/src/net/net.hpp index 2e7a737..0f145bf 100644 --- a/src/net/net.hpp +++ b/src/net/net.hpp @@ -194,7 +194,14 @@ inline void do_session( #endif #ifdef TNN_ASTROBWTV3 case SPECTRE_X: - spectre_stratum_session(host, port, wallet, worker, ioc, ctx, yield, isDev); + switch (hostProtocol) + { + case SPECTRE_SOLO: + break; + case SPECTRE_STRATUM: + spectre_stratum_session(host, port, wallet, worker, ioc, ctx, yield, isDev); + break; + } break; #endif #ifdef TNN_RANDOMX