From 4c6d41b8b653ef90639b1a32f6aab0bb1cef90c5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 10 Oct 2013 23:07:44 +0200 Subject: Refactor/encapsulate chain globals into a CChain class --- src/rpcrawtransaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rpcrawtransaction.cpp') diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index fcc5359dd..5384b6590 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -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)); } -- cgit v1.2.3