Skip to content

Commit d6b2235

Browse files
committed
Merge #13630: Drop unused pindexRet arg to CMerkleTx::GetDepthInMainChain
d6f39b6 Drop unused pindexRet arg to CMerkleTx::GetDepthInMainChain (Ben Woosley) Pull request description: Tree-SHA512: 5f064a47e71113f90f296ab36dae92173ff3fc632ab4e1e85dc71d556cb9239d15939b1e542f4292dab93d336795b7f2e4ae64f6984303c852df8d24f54ccebe
2 parents 8f1106d + d6f39b6 commit d6b2235

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
@@ -4377,7 +4377,7 @@ void CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock)
43774377
nIndex = posInBlock;
43784378
}
43794379

4380-
int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const
4380+
int CMerkleTx::GetDepthInMainChain() const
43814381
{
43824382
if (hashUnset())
43834383
return 0;
@@ -4389,7 +4389,6 @@ int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const
43894389
if (!pindex || !chainActive.Contains(pindex))
43904390
return 0;
43914391

4392-
pindexRet = pindex;
43934392
return ((nIndex == -1) ? (-1) : 1) * (chainActive.Height() - pindex->nHeight + 1);
43944393
}
43954394

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)