diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -234,15 +234,8 @@ * 0 : in memory pool, waiting to be included in a block * >=1 : this many blocks deep in the main chain */ - int GetDepthInMainChain(const CBlockIndex *&pindexRet) const; - int GetDepthInMainChain() const { - const CBlockIndex *pindexRet; - return GetDepthInMainChain(pindexRet); - } - bool IsInMainChain() const { - const CBlockIndex *pindexRet; - return GetDepthInMainChain(pindexRet) > 0; - } + int GetDepthInMainChain() const; + bool IsInMainChain() const { return GetDepthInMainChain() > 0; } /** * @return number of blocks to maturity for this transaction: * 0 : is not a coinbase transaction, or is a mature coinbase transaction diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4629,7 +4629,7 @@ nIndex = posInBlock; } -int CMerkleTx::GetDepthInMainChain(const CBlockIndex *&pindexRet) const { +int CMerkleTx::GetDepthInMainChain() const { if (hashUnset()) { return 0; } @@ -4642,7 +4642,6 @@ return 0; } - pindexRet = pindex; return ((nIndex == -1) ? (-1) : 1) * (chainActive.Height() - pindex->nHeight + 1); }