add longestchain and notarized to getblockchaininfo
This commit is contained in:
@@ -1665,6 +1665,7 @@ void NetworkUpgradeDescPushBack(
|
||||
|
||||
UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
||||
{
|
||||
uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height,longestchain,kmdnotarized_height,txid_height;
|
||||
if (fHelp || params.size() != 0)
|
||||
throw runtime_error(
|
||||
"getblockchaininfo\n"
|
||||
@@ -1720,10 +1721,13 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
||||
int32_t longestchain = KOMODO_LONGESTCHAIN;//komodo_longestchain();
|
||||
progress = (longestchain > 0 ) ? (double) chainActive.Height() / longestchain : 1.0;
|
||||
}
|
||||
notarized_height = komodo_notarized_height(&prevMoMheight,¬arized_hash,¬arized_desttxid);
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.push_back(Pair("chain", Params().NetworkIDString()));
|
||||
obj.push_back(Pair("blocks", (int)chainActive.Height()));
|
||||
obj.push_back(Pair("synced", KOMODO_INSYNC!=0));
|
||||
obj.push_back(Pair("longestchain", KOMODO_LONGESTCHAIN));
|
||||
obj.push_back(Pair("notarized", notarized_height));
|
||||
obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->GetHeight() : -1));
|
||||
obj.push_back(Pair("bestblockhash", chainActive.LastTip()->GetBlockHash().GetHex()));
|
||||
obj.push_back(Pair("difficulty", (double)GetNetworkDifficulty()));
|
||||
|
||||
Reference in New Issue
Block a user