Refactor/encapsulate chain globals into a CChain class

This commit is contained in:
Pieter Wuille
2013-10-10 23:07:44 +02:00
parent c74b6c3d8f
commit 4c6d41b8b6
19 changed files with 217 additions and 213 deletions

View File

@@ -87,9 +87,9 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry)
if (mi != mapBlockIndex.end() && (*mi).second)
{
CBlockIndex* pindex = (*mi).second;
if (pindex->IsInMainChain())
if (chainActive.Contains(pindex))
{
entry.push_back(Pair("confirmations", 1 + nBestHeight - pindex->nHeight));
entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight));
entry.push_back(Pair("time", (boost::int64_t)pindex->nTime));
entry.push_back(Pair("blocktime", (boost::int64_t)pindex->nTime));
}