Paweł Bylica
8 years ago
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
2 changed files with
6 additions and
7 deletions
-
libstratum/EthStratumClient.cpp
-
libstratum/EthStratumClient.h
|
@ -54,7 +54,8 @@ EthStratumClient::EthStratumClient(GenericFarm<EthashProofOfWork> * f, MinerType |
|
|
|
|
|
|
|
|
EthStratumClient::~EthStratumClient() |
|
|
EthStratumClient::~EthStratumClient() |
|
|
{ |
|
|
{ |
|
|
|
|
|
m_io_service.stop(); |
|
|
|
|
|
m_serviceThread.join(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EthStratumClient::setFailover(string const & host, string const & port) |
|
|
void EthStratumClient::setFailover(string const & host, string const & port) |
|
@ -81,7 +82,7 @@ void EthStratumClient::connect() |
|
|
|
|
|
|
|
|
cnote << "Connecting to stratum server " << p_active->host + ":" + p_active->port; |
|
|
cnote << "Connecting to stratum server " << p_active->host + ":" + p_active->port; |
|
|
|
|
|
|
|
|
std::thread t(boost::bind(&boost::asio::io_service::run, &m_io_service)); |
|
|
m_serviceThread = std::thread{boost::bind(&boost::asio::io_service::run, &m_io_service)}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#define BOOST_ASIO_ENABLE_CANCELIO |
|
|
#define BOOST_ASIO_ENABLE_CANCELIO |
|
@ -265,7 +266,6 @@ void EthStratumClient::readResponse(const boost::system::error_code& ec, std::si |
|
|
if (reader.parse(response.c_str(), responseObject)) |
|
|
if (reader.parse(response.c_str(), responseObject)) |
|
|
{ |
|
|
{ |
|
|
processReponse(responseObject); |
|
|
processReponse(responseObject); |
|
|
m_response = response; |
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|
@ -67,7 +67,6 @@ private: |
|
|
|
|
|
|
|
|
boost::mutex x_pending; |
|
|
boost::mutex x_pending; |
|
|
int m_pending; |
|
|
int m_pending; |
|
|
string m_response; |
|
|
|
|
|
|
|
|
|
|
|
GenericFarm<EthashProofOfWork> * p_farm; |
|
|
GenericFarm<EthashProofOfWork> * p_farm; |
|
|
boost::mutex x_current; |
|
|
boost::mutex x_current; |
|
@ -78,8 +77,8 @@ private: |
|
|
|
|
|
|
|
|
string m_job; |
|
|
string m_job; |
|
|
string m_previousJob; |
|
|
string m_previousJob; |
|
|
EthashAux::FullType m_dag; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::thread m_serviceThread; ///< The IO service thread.
|
|
|
boost::asio::io_service m_io_service; |
|
|
boost::asio::io_service m_io_service; |
|
|
tcp::socket m_socket; |
|
|
tcp::socket m_socket; |
|
|
|
|
|
|
|
|