Fix getbalance() bug
[novacoin.git] / src / rpcblockchain.cpp
index d19869d..69e436c 100644 (file)
@@ -102,9 +102,9 @@ double GetPoSKernelPS()
 Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool fPrintTransactionDetail)
 {
     Object result;
-    result.push_back(Pair("hash", block.GetHash().GetHex()));
+    result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex()));
     CMerkleTx txGen(block.vtx[0]);
-    txGen.SetMerkleBranch(block);
+    txGen.SetMerkleBranch(&block);
     result.push_back(Pair("confirmations", (int)txGen.GetDepthInMainChain()));
     result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION)));
     result.push_back(Pair("height", blockindex->nHeight));