Skip to content

Commit

Permalink
--wallet flag bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tritonn204 committed Oct 19, 2024
1 parent 90f42d7 commit fa7c71b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
2 changes: 2 additions & 0 deletions include/tnn-common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/coins/dummy_miners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ blankfunc(mineNexellia);
#ifndef TNN_HOOHASH
blankfunc(mineHoosat);
#endif

// Hoosat
#ifndef TNN_WALAHASH
blankfunc(mineWaglayla);
#endif
2 changes: 1 addition & 1 deletion src/coins/mine_spectre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/coins/mine_waglayla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char> diffHex;
// cmpDiff.print(diffHex, 16);
// std::cout << "difficulty (LE): " << std::string(diffHex.data()).c_str() << std::endl;
Expand All @@ -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;
}
Expand Down
7 changes: 4 additions & 3 deletions src/core/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/net/kas/net_kas_stratum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion src/net/net.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa7c71b

Please sign in to comment.