From d6f39b6c6429fa3f8b496940cf001aaa648e9a21 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Wed, 11 Jul 2018 00:22:10 -0400 Subject: [PATCH] Drop unused pindexRet arg to CMerkleTx::GetDepthInMainChain --- src/wallet/wallet.cpp | 3 +-- src/wallet/wallet.h | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index adc48a865..506c4ee34 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4416,7 +4416,7 @@ void CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock) nIndex = posInBlock; } -int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const +int CMerkleTx::GetDepthInMainChain() const { if (hashUnset()) return 0; @@ -4428,7 +4428,6 @@ int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const if (!pindex || !chainActive.Contains(pindex)) return 0; - pindexRet = pindex; return ((nIndex == -1) ? (-1) : 1) * (chainActive.Height() - pindex->nHeight + 1); } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index b82939484..663538dc0 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -267,9 +267,8 @@ public: * 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; } int GetBlocksToMaturity() const; bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); } bool isAbandoned() const { return (hashBlock == ABANDON_HASH); }