Skip to content

Commit dde8dad

Browse files
committed
Remove Stratum JsonRpc 2 Field.
Stratum does not strictly follow the Protocol apparently... They even claimed to be based on 2, but in the examples they never use the mandatory "jsonrpc": "2.0"... https://web.archive.org/web/20150307191254/http://mining.bitcoin.cz/stratum-mining Signed-off-by: Pttn <28868425+Pttn@users.noreply.github.com>
1 parent 52265e5 commit dde8dad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

StratumClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void StratumClient::_processMessage(const std::string &message) {
186186
}
187187
logger.log("ExtraNonce1 = "s + v8ToHexStr(_extraNonce1) + "\n"s);
188188
logger.log("extraNonce2Len = "s + std::to_string(_extraNonce2Len) + "\n"s);
189-
const std::string miningAuthorizeMessage("{\"jsonrpc\": \"2.0\", \"id\": "s + std::to_string(_jsonId++) + ", \"method\": \"mining.authorize\", \"params\": [\""s + _username + "\", \""s + _password + "\"]}\n"s);
189+
const std::string miningAuthorizeMessage("{\"id\": "s + std::to_string(_jsonId++) + ", \"method\": \"mining.authorize\", \"params\": [\""s + _username + "\", \""s + _password + "\"]}\n"s);
190190
// logger.logDebug("Sending: "s + miningAuthorizeMessage);
191191
size_t bytesSent(0);
192192
CURLcode cc(curl_easy_send(_curl, miningAuthorizeMessage.c_str(), miningAuthorizeMessage.size(), &bytesSent));
@@ -267,7 +267,7 @@ void StratumClient::connect() {
267267
}
268268
logger.log("Host: "s + _host + " -> " + ip + "\n"s);
269269
if (_state == UNSUBSCRIBED) {
270-
const std::string miningSubscribeMessage("{\"jsonrpc\": \"2.0\", \"id\": "s + std::to_string(_jsonId++) + ", \"method\": \"mining.subscribe\", \"params\": [\""s + userAgent + "\"]}\n"s);
270+
const std::string miningSubscribeMessage("{\"id\": "s + std::to_string(_jsonId++) + ", \"method\": \"mining.subscribe\", \"params\": [\""s + userAgent + "\"]}\n"s);
271271
size_t bytesSent(0);
272272
cc = curl_easy_send(_curl, miningSubscribeMessage.c_str(), miningSubscribeMessage.size(), &bytesSent);
273273
logger.logDebug("Sending: "s + miningSubscribeMessage);
@@ -305,7 +305,7 @@ void StratumClient::process() {
305305
_shares++;
306306
logger.logDebug(Stella::formattedClockTimeNow() + " "s + std::to_string(share.primeCount) + "-share found by worker thread "s + std::to_string(share.threadId) + "\n"s);
307307
std::ostringstream oss;
308-
oss << "{\"jsonrpc\": \"2.0\", \"id\": " << std::to_string(_jsonId++) << ", \"method\": \"mining.submit\", \"params\": [\""
308+
oss << "{\"id\": " << std::to_string(_jsonId++) << ", \"method\": \"mining.submit\", \"params\": [\""
309309
<< _username << "\", \""
310310
<< job.jobId << "\", \""
311311
<< v8ToHexStr(job.extraNonce2) << "\", \""

0 commit comments

Comments
 (0)