use cached block hash in blockToJSON()

This commit is contained in:
Pavel Vasin
2016-03-12 17:11:59 +03:00
committed by lateminer
parent b8d0c5dacc
commit 7393f538e0

View File

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