Browse Source

Merge #7670: use cached block hash in blockToJSON()

a6ee0ca use cached block hash in blockToJSON() (Pavel Vasin)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
c9a1265754
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 2
      src/rpc/blockchain.cpp

2
src/rpc/blockchain.cpp

@ -89,7 +89,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex) @@ -89,7 +89,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false)
{
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))

Loading…
Cancel
Save