|
|
@ -89,7 +89,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
|
|
|
|
UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false)
|
|
|
|
UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
UniValue result(UniValue::VOBJ);
|
|
|
|
UniValue result(UniValue::VOBJ);
|
|
|
|
result.push_back(Pair("hash", block.GetHash().GetHex()));
|
|
|
|
result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex()));
|
|
|
|
int confirmations = -1;
|
|
|
|
int confirmations = -1;
|
|
|
|
// Only report confirmations if the block is on the main chain
|
|
|
|
// Only report confirmations if the block is on the main chain
|
|
|
|
if (chainActive.Contains(blockindex))
|
|
|
|
if (chainActive.Contains(blockindex))
|
|
|
|