core code changes to implement yescrypt as relacement for qubit

This commit is contained in:
nzsquirrell
2016-06-18 20:39:19 +12:00
parent 728f6d3910
commit 03d553c81e
11 changed files with 110 additions and 27 deletions
+10 -2
View File
@@ -12,6 +12,7 @@
#include "rpcserver.h"
#include "sync.h"
#include "util.h"
#include "myriad_params.h"
#include <stdint.h>
@@ -108,7 +109,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDe
result.push_back(Pair("version", block.nVersion.GetFullVersion()));
int algo = block.GetAlgo();
result.push_back(Pair("pow_algo_id", algo));
result.push_back(Pair("pow_algo", GetAlgoName(algo)));
result.push_back(Pair("pow_algo", GetAlgoName(algo, block.GetBlockTime())));
result.push_back(Pair("pow_hash", block.GetPoWHash(algo).GetHex()));
result.push_back(Pair("merkleroot", block.hashMerkleRoot.GetHex()));
Array txs;
@@ -596,7 +597,14 @@ Value getblockchaininfo(const Array& params, bool fHelp)
obj.push_back(Pair("difficulty_scrypt", (double)GetDifficulty(NULL, ALGO_SCRYPT)));
obj.push_back(Pair("difficulty_groestl", (double)GetDifficulty(NULL, ALGO_GROESTL)));
obj.push_back(Pair("difficulty_skein", (double)GetDifficulty(NULL, ALGO_SKEIN)));
obj.push_back(Pair("difficulty_qubit", (double)GetDifficulty(NULL, ALGO_QUBIT)));
if(GetTime() >= nTimeYescryptStart)
{
obj.push_back(Pair("difficulty_yescrypt",(double)GetDifficulty(NULL, ALGO_CPU)));
}
else
{
obj.push_back(Pair("difficulty_qubit", (double)GetDifficulty(NULL, ALGO_CPU)));
}
obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(Params().Checkpoints(), chainActive.Tip())));
obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex()));
obj.push_back(Pair("pruned", fPruneMode));