Add a persistent screen showing basic node metrics

The screen is implemented using ANSI Escape sequences.

Closes #1331
This commit is contained in:
Jack Grigg
2016-09-04 04:39:45 +12:00
parent f39d176ebf
commit a6df7ab567
7 changed files with 204 additions and 3 deletions

View File

@@ -11,6 +11,7 @@
#include "crypto/equihash.h"
#include "init.h"
#include "main.h"
#include "metrics.h"
#include "miner.h"
#include "net.h"
#include "pow.h"
@@ -193,13 +194,17 @@ Value generate(const Array& params, bool fHelp)
pblock->nSolution = soln;
return CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus());
};
if (EhBasicSolveUncancellable(n, k, curr_state, validBlock))
bool found = EhBasicSolveUncancellable(n, k, curr_state, validBlock);
ehSolverRuns.increment();
if (found) {
goto endloop;
}
}
endloop:
CValidationState state;
if (!ProcessNewBlock(state, NULL, pblock, true, NULL))
throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted");
minedBlocks.increment();
++nHeight;
blockHashes.push_back(pblock->GetHash().GetHex());
}