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

Commit

Permalink
Merge pull request #1300 from StefanOberhumer/MinimalChanges
Browse files Browse the repository at this point in the history
Different small changes
  • Loading branch information
jean-m-cyr authored Jun 24, 2018
2 parents 39c6941 + 3bac573 commit 07cfba7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Basic API authentication to protect exposure of API port to the internet [#1228](/~https://github.com/ethereum-mining/ethminer/pull/1228).
- Add `ispaused` information into response of `miner_getstathr` API query [#1232](/~https://github.com/ethereum-mining/ethminer/pull/1232).
- API responses return "ethminer-" as version prefix. [#1300](/~https://github.com/ethereum-mining/ethminer/pull/1300).

## 0.15.0rc1

Expand Down
4 changes: 2 additions & 2 deletions docs/API_DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ and expect back a response like this:
"id": 1,
"jsonrpc": "2.0",
"result": [
"0.16.0.dev0+commit.41639944", // The actual release of ethminer
"ethminer-0.16.0.dev0+commit.41639944", // Running ethminer's version
"48", // Total running time in minutes
"87221;54;0", // ETH hashrate in KH/s, submitted shares, rejected shares
"14683;14508;14508;14508;14508;14508", // Detailed ETH hashrate in KH/s per GPU
Expand Down Expand Up @@ -257,7 +257,7 @@ and expect back a response like this:
true,
false
],
"version": "0.16.0.dev0+commit.41639944" // Running ethminer's version
"version": "ethminer-0.16.0.dev0+commit.41639944" // Running ethminer's version
}
}
```
Expand Down
8 changes: 4 additions & 4 deletions libapicore/ApiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ Json::Value ApiConnection::getMinerStat1()

Json::Value jRes;

jRes[0] = ethminer_get_buildinfo()->project_version; //miner version.
jRes[0] = std::string("ethminer-") + ethminer_get_buildinfo()->project_version; //miner version.
jRes[1] = toString(runningTime.count()); // running time, in minutes.
jRes[2] = totalMhEth.str(); // total ETH hashrate in MH/s, number of ETH shares, number of ETH rejected shares.
jRes[3] = detailedMhEth.str(); // detailed ETH hashrate for all GPUs.
Expand Down Expand Up @@ -657,7 +657,7 @@ Json::Value ApiConnection::getMinerStatHR()
Json::Value ispaused;
ostringstream poolAddresses;

version << ethminer_get_buildinfo()->project_version;
version << "ethminer-" << ethminer_get_buildinfo()->project_version;
runtime << toString(runningTime.count());
poolAddresses << m_farm.get_pool_addresses();

Expand All @@ -681,8 +681,8 @@ Json::Value ApiConnection::getMinerStatHR()
}

Json::Value jRes;
jRes["version"] = version.str(); // miner version.
jRes["runtime"] = runtime.str(); // running time, in minutes.
jRes["version"] = version.str(); // miner version.
jRes["runtime"] = runtime.str(); // running time, in minutes.
// total ETH hashrate in MH/s, number of ETH shares, number of ETH rejected shares.
jRes["ethhashrate"] = (p.rate());
jRes["ethhashrates"] = detailedMhEth;
Expand Down
4 changes: 2 additions & 2 deletions libapicore/httpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ httpServer http_server;

void httpServer::tableHeader(stringstream& ss, unsigned columns)
{
auto info = ethminer_get_buildinfo();
auto version = std::string("ethminer-") + ethminer_get_buildinfo()->project_version;
char hostName[HOST_NAME_MAX + 1];
gethostname(hostName, HOST_NAME_MAX + 1);
string l = m_farm->farmLaunchedFormatted();
ss <<
"<html><head><title>" << hostName <<
"</title><style>tr:nth-child(even){background-color:Gainsboro;}</style>"
"<meta http-equiv=refresh content=30></head><body><table width=\"50%\" border=1 cellpadding=2 cellspacing=0 align=center>"
"<tr valign=top align=center style=background-color:Gold><th colspan=" << columns << ">" << info->project_version <<
"<tr valign=top align=center style=background-color:Gold><th colspan=" << columns << ">" << version <<
" on " << hostName << " - " << l << "</th></tr>";
}

Expand Down
6 changes: 3 additions & 3 deletions libethcore/Miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class Miner: public Worker
void update_temperature(unsigned temperature)
{
/*
cnote << "Setting temp" << temperature << " for gpu/" << index <<
cnote << "Setting temp" << temperature << " for gpu" << index <<
" tstop=" << farm.get_tstop() << " tstart=" << farm.get_tstart();
*/
bool _wait_for_tstart_temp = m_wait_for_tstart_temp.load(std::memory_order_relaxed);
Expand All @@ -244,14 +244,14 @@ class Miner: public Worker
unsigned tstop = farm.get_tstop();
if (tstop && temperature >= tstop)
{
cwarn << "Pause mining on gpu/" << index << " : temperature " << temperature << " is above --tstop " << tstop;
cwarn << "Pause mining on gpu" << index << " : temperature " << temperature << " is above --tstop " << tstop;
m_wait_for_tstart_temp.store(true, std::memory_order_relaxed);
}
} else {
unsigned tstart = farm.get_tstart();
if (tstart && temperature <= tstart)
{
cnote << "(Re)starting mining on gpu/" << index << " : temperature " << temperature << " is now below --tstart " << tstart;
cnote << "(Re)starting mining on gpu" << index << " : temperature " << temperature << " is now below --tstart " << tstart;
m_wait_for_tstart_temp.store(false, std::memory_order_relaxed);
}
}
Expand Down

0 comments on commit 07cfba7

Please sign in to comment.