Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 901d33c

Browse files
committedMay 8, 2018
Added some error reason
1 parent 25bcc5a commit 901d33c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎libpoolprotocols/stratum/EthStratumClient.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,15 @@ void EthStratumClient::connect_handler(const boost::system::error_code& ec, tcp:
368368
jReq["method"] = "mining.subscribe";
369369
jReq["params"] = Json::Value(Json::arrayValue);
370370

371-
m_worker = "";
371+
m_worker.clear();
372372
p = m_conn.User().find_first_of(".");
373373
if (p != string::npos) {
374374
user = m_conn.User().substr(0, p);
375-
m_worker = m_conn.User().substr(p + 1);
375+
376+
// There should be at least one char after dot
377+
// returned p is zero based
378+
if (p < (m_conn.User().length() -1))
379+
m_worker = m_conn.User().substr(++p);
376380
}
377381
else
378382
user = m_conn.User();
@@ -662,7 +666,7 @@ void EthStratumClient::processReponse(Json::Value& responseObject)
662666
m_subscribed.store(_isSuccess, std::memory_order_relaxed);
663667
if (!m_subscribed)
664668
{
665-
cnote << "Could not login to ethproxy server";
669+
cnote << "Could not login to ethproxy server:" << _errReason;
666670
disconnect();
667671
return;
668672
}
@@ -684,7 +688,7 @@ void EthStratumClient::processReponse(Json::Value& responseObject)
684688
m_subscribed.store(_isSuccess, std::memory_order_relaxed);
685689
if (!m_subscribed)
686690
{
687-
cnote << "Could not subscribe to stratum server";
691+
cnote << "Could not subscribe to stratum server:" << _errReason;
688692
disconnect();
689693
return;
690694
}

0 commit comments

Comments
 (0)
This repository has been archived.