aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2014-10-24 16:13:41 +0200
committerDaniel Kraft <d@domob.eu>2014-10-24 16:13:41 +0200
commita31e8bad53e44629b26e7f36e0431b9fa01c1ed6 (patch)
treeba360bbcb5471fbc049dc1e0abe225e683baa6f7 /src/wallet.h
parent3552d4b859d56726cd25baa6f1e5988050bdad33 (diff)
downloadbitcoin-a31e8bad53e44629b26e7f36e0431b9fa01c1ed6.tar.xz
Make CBlockIndex* returned by GetDepthInMainChain const.
Make the CBlockIndex* (optionally) returned by GetDepthInMainChain const. This prevents accidental modification. The result is for reading its properties rather than modifying it.
Diffstat (limited to 'src/wallet.h')
-rw-r--r--src/wallet.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet.h b/src/wallet.h
index 06706655f8..9b6895090c 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -474,7 +474,7 @@ struct COutputEntry
class CMerkleTx : public CTransaction
{
private:
- int GetDepthInMainChainINTERNAL(CBlockIndex* &pindexRet) const;
+ int GetDepthInMainChainINTERNAL(const CBlockIndex* &pindexRet) const;
public:
uint256 hashBlock;
@@ -519,9 +519,9 @@ public:
// -1 : not in blockchain, and not in memory pool (conflicted transaction)
// 0 : in memory pool, waiting to be included in a block
// >=1 : this many blocks deep in the main chain
- int GetDepthInMainChain(CBlockIndex* &pindexRet) const;
- int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); }
- bool IsInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; }
+ int GetDepthInMainChain(const CBlockIndex* &pindexRet) const;
+ int GetDepthInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); }
+ bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; }
int GetBlocksToMaturity() const;
bool AcceptToMemoryPool(bool fLimitFree=true, bool fRejectInsaneFee=true);
};