@@ -28,6 +28,8 @@ boost::synchronized_value<std::list<std::string>> messageBox;
|
|||||||
boost::synchronized_value<std::string> initMessage;
|
boost::synchronized_value<std::string> initMessage;
|
||||||
bool loaded = false;
|
bool loaded = false;
|
||||||
|
|
||||||
|
extern int64_t GetNetworkHashPS(int lookup, int height);
|
||||||
|
|
||||||
void TrackMinedBlock(uint256 hash)
|
void TrackMinedBlock(uint256 hash)
|
||||||
{
|
{
|
||||||
minedBlocks.increment();
|
minedBlocks.increment();
|
||||||
@@ -74,6 +76,18 @@ void ConnectMetricsScreen()
|
|||||||
uiInterface.InitMessage.connect(metrics_InitMessage);
|
uiInterface.InitMessage.connect(metrics_InitMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int printNetworkStats()
|
||||||
|
{
|
||||||
|
LOCK2(cs_main, cs_vNodes);
|
||||||
|
|
||||||
|
std::cout << " " << _("Block height") << " | " << chainActive.Height() << std::endl;
|
||||||
|
std::cout << " " << _("Network solution rate") << " | " << GetNetworkHashPS(120, -1) << " Sol/s" << std::endl;
|
||||||
|
std::cout << " " << _("Connections") << " | " << vNodes.size() << std::endl;
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
int printMiningStatus(bool mining)
|
int printMiningStatus(bool mining)
|
||||||
{
|
{
|
||||||
// Number of lines that are always displayed
|
// Number of lines that are always displayed
|
||||||
@@ -88,7 +102,8 @@ int printMiningStatus(bool mining)
|
|||||||
else
|
else
|
||||||
nThreads = boost::thread::hardware_concurrency();
|
nThreads = boost::thread::hardware_concurrency();
|
||||||
}
|
}
|
||||||
std::cout << strprintf(_("You are running %d mining threads."), nThreads) << std::endl;
|
std::cout << strprintf(_("You are mining with the %s solver on %d threads."),
|
||||||
|
GetArg("-equihashsolver", "default"), nThreads) << std::endl;
|
||||||
lines++;
|
lines++;
|
||||||
} else {
|
} else {
|
||||||
std::cout << _("You are currently not mining.") << std::endl;
|
std::cout << _("You are currently not mining.") << std::endl;
|
||||||
@@ -258,6 +273,9 @@ void ThreadShowMetricsScreen()
|
|||||||
// Miner status
|
// Miner status
|
||||||
bool mining = GetBoolArg("-gen", false);
|
bool mining = GetBoolArg("-gen", false);
|
||||||
|
|
||||||
|
if (loaded) {
|
||||||
|
lines += printNetworkStats();
|
||||||
|
}
|
||||||
lines += printMiningStatus(mining);
|
lines += printMiningStatus(mining);
|
||||||
lines += printMetrics(cols, nStart, mining);
|
lines += printMetrics(cols, nStart, mining);
|
||||||
lines += printMessageBox(cols);
|
lines += printMessageBox(cols);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ using namespace std;
|
|||||||
* or over the difficulty averaging window if 'lookup' is nonpositive.
|
* or over the difficulty averaging window if 'lookup' is nonpositive.
|
||||||
* If 'height' is nonnegative, compute the estimate at the time when a given block was found.
|
* If 'height' is nonnegative, compute the estimate at the time when a given block was found.
|
||||||
*/
|
*/
|
||||||
Value GetNetworkHashPS(int lookup, int height) {
|
int64_t GetNetworkHashPS(int lookup, int height) {
|
||||||
CBlockIndex *pb = chainActive.Tip();
|
CBlockIndex *pb = chainActive.Tip();
|
||||||
|
|
||||||
if (height >= 0 && height < chainActive.Height())
|
if (height >= 0 && height < chainActive.Height())
|
||||||
|
|||||||
Reference in New Issue
Block a user