Skip to content

Commit d6f39b6

Browse files
committed
Drop unused pindexRet arg to CMerkleTx::GetDepthInMainChain
1 parent fad42e8 commit d6f39b6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4416,7 +4416,7 @@ void CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock)
44164416
nIndex = posInBlock;
44174417
}
44184418

4419-
int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const
4419+
int CMerkleTx::GetDepthInMainChain() const
44204420
{
44214421
if (hashUnset())
44224422
return 0;
@@ -4428,7 +4428,6 @@ int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const
44284428
if (!pindex || !chainActive.Contains(pindex))
44294429
return 0;
44304430

4431-
pindexRet = pindex;
44324431
return ((nIndex == -1) ? (-1) : 1) * (chainActive.Height() - pindex->nHeight + 1);
44334432
}
44344433

src/wallet/wallet.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,8 @@ class CMerkleTx
267267
* 0 : in memory pool, waiting to be included in a block
268268
* >=1 : this many blocks deep in the main chain
269269
*/
270-
int GetDepthInMainChain(const CBlockIndex* &pindexRet) const;
271-
int GetDepthInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); }
272-
bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; }
270+
int GetDepthInMainChain() const;
271+
bool IsInMainChain() const { return GetDepthInMainChain() > 0; }
273272
int GetBlocksToMaturity() const;
274273
bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); }
275274
bool isAbandoned() const { return (hashBlock == ABANDON_HASH); }

0 commit comments

Comments
 (0)