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

Commit

Permalink
Stratum Revised
Browse files Browse the repository at this point in the history
Stratum implementation revised.
Sanity checks over rpc messages
Json messages built using Json::Value instead of string concatenation
(better readable)
Adjusted syntax for eth_SubmitHasrate (requires worker)

Addresses and solves
#1041
#1038
#1036
#1023
#936
#940
  • Loading branch information
AndreaLanfranchi committed Apr 30, 2018
1 parent be77227 commit 6dabf77
Show file tree
Hide file tree
Showing 3 changed files with 476 additions and 127 deletions.
7 changes: 6 additions & 1 deletion libpoolprotocols/PoolManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ void PoolManager::workLoop()
std::string h = toHex(toCompactBigEndian(mp.rate(), 1));
std::string res = h[0] != '0' ? h : h.substr(1);

p_client->submitHashrate("0x" + res);
// Should be 32 bytes
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_submithashrate
std::ostringstream ss;
ss << std::setw(64) << std::setfill('0') << res;

p_client->submitHashrate("0x" + ss.str());
m_hashrateReportingTimePassed = 0;
}
}
Expand Down
Loading

0 comments on commit 6dabf77

Please sign in to comment.