diff options
| author | Daniel Kraft <[email protected]> | 2014-07-19 16:42:48 +0200 |
|---|---|---|
| committer | Daniel Kraft <[email protected]> | 2014-08-26 11:29:18 +0200 |
| commit | a3dc587a62f5d12aea1ff8139198bf0441535c5f (patch) | |
| tree | 4759437af72c07a075c6819bb5c2435d7350f0d8 /src/txmempool.cpp | |
| parent | Mark LevelDB "Read" and "Exists" functions as const. (diff) | |
| download | discoin-a3dc587a62f5d12aea1ff8139198bf0441535c5f.tar.xz discoin-a3dc587a62f5d12aea1ff8139198bf0441535c5f.zip | |
Make appropriate getter-routines "const" in CCoinsView.
Mark the "Get"/"Have" routines in CCoinsView and subclasses as "const".
Diffstat (limited to 'src/txmempool.cpp')
| -rw-r--r-- | src/txmempool.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 80cae6824..3845a35b3 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -625,7 +625,7 @@ void CTxMemPool::ClearPrioritisation(const uint256 hash) CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { } -bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) { +bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) const { // If an entry in the mempool exists, always return that one, as it's guaranteed to never // conflict with the underlying cache, and it cannot have pruned entries (as it contains full) // transactions. First checking the underlying cache risks returning a pruned entry instead. @@ -637,7 +637,7 @@ bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) { return (base->GetCoins(txid, coins) && !coins.IsPruned()); } -bool CCoinsViewMemPool::HaveCoins(const uint256 &txid) { +bool CCoinsViewMemPool::HaveCoins(const uint256 &txid) const { return mempool.exists(txid) || base->HaveCoins(txid); } |