Reimplement whole stratum network communication with boost::asio (#90)

Logger is now thread safe
This commit is contained in:
Ben Gräf 2018-04-14 19:55:13 +02:00 committed by GitHub
parent 15d752d9e0
commit df084acff6
40 changed files with 915 additions and 1942 deletions

View file

@ -57,7 +57,7 @@ Network::Network(const Options *options) :
const std::vector<Url*> &pools = options->pools();
#ifndef XMRIG_NO_TLS
ssl_init();
//ssl_init();
#endif
if (pools.size() > 1) {
@ -81,7 +81,7 @@ Network::Network(const Options *options) :
Network::~Network()
{
#ifndef XMRIG_NO_TLS
ssl_destroy();
//ssl_destroy();
#endif
}
@ -170,10 +170,12 @@ void Network::onResultAccepted(Client *client, const SubmitResult &result, const
void Network::setJob(Client *client, const Job &job)
{
if (m_options->colors()) {
LOG_INFO("\x1B[01;35mnew job\x1B[0m from \x1B[01;37m%s:%d\x1B[0m diff \x1B[01;37m%d", client->host(), client->port(), job.diff());
LOG_INFO("\x1B[01;35mnew job\x1B[0m from \x1B[01;37m%s:%d\x1B[0m with diff \x1B[01;37m%d\x1B[0m and PoW \x1B[01;37mv%d",
client->host(), client->port(), job.diff(), job.powVersion());
}
else {
LOG_INFO("new job from %s:%d diff %d", client->host(), client->port(), job.diff());
LOG_INFO("new job from %s:%d with diff %d and PoW v%d",
client->host(), client->port(), job.diff(), job.powVersion());
}
m_state.diff = job.diff();