|
|
@ -118,7 +118,8 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex) |
|
|
|
// Only report confirmations if the block is on the main chain
|
|
|
|
if (chainActive.Contains(blockindex)) |
|
|
|
confirmations = chainActive.Height() - blockindex->nHeight + 1; |
|
|
|
result.push_back(Pair("confirmations", confirmations)); |
|
|
|
result.push_back(Pair("confirmations", komodo_dpowconfs(blockindex->nHeight,confirmations))); |
|
|
|
result.push_back(Pair("rawconfirmations", confirmations)); |
|
|
|
result.push_back(Pair("height", blockindex->nHeight)); |
|
|
|
result.push_back(Pair("version", blockindex->nVersion)); |
|
|
|
result.push_back(Pair("merkleroot", blockindex->hashMerkleRoot.GetHex())); |
|
|
@ -149,7 +150,8 @@ UniValue blockToDeltasJSON(const CBlock& block, const CBlockIndex* blockindex) |
|
|
|
} else { |
|
|
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block is an orphan"); |
|
|
|
} |
|
|
|
result.push_back(Pair("confirmations", confirmations)); |
|
|
|
result.push_back(Pair("confirmations", komodo_dpowconfs(blockindex->nHeight,confirmations))); |
|
|
|
result.push_back(Pair("rawconfirmations", confirmations)); |
|
|
|
result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION))); |
|
|
|
result.push_back(Pair("height", blockindex->nHeight)); |
|
|
|
result.push_back(Pair("version", block.nVersion)); |
|
|
@ -266,7 +268,8 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx |
|
|
|
// Only report confirmations if the block is on the main chain
|
|
|
|
if (chainActive.Contains(blockindex)) |
|
|
|
confirmations = chainActive.Height() - blockindex->nHeight + 1; |
|
|
|
result.push_back(Pair("confirmations", confirmations)); |
|
|
|
result.push_back(Pair("confirmations", komodo_dpowconfs(blockindex->nHeight,confirmations))); |
|
|
|
result.push_back(Pair("rawconfirmations", confirmations)); |
|
|
|
result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION))); |
|
|
|
result.push_back(Pair("height", blockindex->nHeight)); |
|
|
|
result.push_back(Pair("version", block.nVersion)); |
|
|
|