Skip to content

Commit

Permalink
Xatum mainnet launch (#24)
Browse files Browse the repository at this point in the history
* Added http server to query miner stats

* Rework CMake (#21)

* Add build scripts and Building.md

* Use CPMAddPackage for Boost if we cannot find it locally

* Build on all branches

* Call --dero-test

* System update is slow. Stop doing it.

* Cleanup

* Fix a few build warnings

* Add --xelis-test to GH workflow

* Use Boost 1.85 if OS packages weren't found

---------

Co-authored-by: Tritonn204 <tritonn204@gmail.com>

* Corrected my merge conflict resolution in CMakeLists

* Xatum works

* Accepted + Rejected counters work with xatum

---------

Co-authored-by: dirkerdero <126991543+dirkerdero@users.noreply.github.com>
  • Loading branch information
Tritonn204 and dirkerdero authored Apr 30, 2024
1 parent b122910 commit 562aaf1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/miner/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,12 @@ int handleXatumPacket(Xatum::packet xPacket, bool isDev)
if (command == Xatum::print)
{
mutex.lock();
if (Xatum::accepted.compare(data.at("msg").get<std::string>()) == 0)
accepted++;

if (Xatum::stale.compare(data.at("msg").get<std::string>()) == 0)
rejected++;

int msgLevel = data.at("lvl").get<int>();
if (msgLevel < Xatum::logLevel)
return 0;
Expand Down Expand Up @@ -1000,7 +1006,11 @@ int handleXatumPacket(Xatum::packet xPacket, bool isDev)
setcolor(BRIGHT_WHITE);
}
*diff = data.at("diff").get<uint64_t>();
(*J).emplace("template", (*B).c_str());

if ((*J).contains("template"))
(*J).at("template") = (*B).c_str();
else
(*J).emplace("template", (*B).c_str());

bool *C = isDev ? &devConnected : &isConnected;

Expand Down
3 changes: 3 additions & 0 deletions src/xatum/xatum.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ namespace Xatum
std::string pingPacket = "ping~{}\n";
std::string pongPacket = "pong~{}\n";

std::string accepted = "share accepted";
std::string stale = "invalid extra nonce";

const int ERROR_MSG = 3;
const int WARN_MSG = 2;
const int INFO_MSG = 1;
Expand Down

0 comments on commit 562aaf1

Please sign in to comment.