mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Refactor/encapsulate chain globals into a CChain class
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user