diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-08-26 16:47:44 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-08-26 16:49:02 +0200 |
commit | 790911ff0a659becd983afd5309b2c16401ba28d (patch) | |
tree | 0e8013882018d752e12b86de7f854cfb30143d19 /src/txmempool.cpp | |
parent | 0d763fc9e148f753cff19daea23866f139ad0a7f (diff) | |
parent | d0867acb0e07ac63f03dcc555387f24322e8799e (diff) | |
download | bitcoin-790911ff0a659becd983afd5309b2c16401ba28d.tar.xz |
Merge pull request #4561
d0867ac Use const CCoinsView's at some places. (Daniel Kraft)
a3dc587 Make appropriate getter-routines "const" in CCoinsView. (Daniel Kraft)
ffb4c21 Mark LevelDB "Read" and "Exists" functions as const. (Daniel Kraft)
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r-- | src/txmempool.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 80cae68244..f75e2212d5 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -484,7 +484,7 @@ void CTxMemPool::clear() ++nTransactionsUpdated; } -void CTxMemPool::check(CCoinsViewCache *pcoins) const +void CTxMemPool::check(const CCoinsViewCache *pcoins) const { if (!fSanityCheck) return; @@ -505,7 +505,7 @@ void CTxMemPool::check(CCoinsViewCache *pcoins) const const CTransaction& tx2 = it2->second.GetTx(); assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull()); } else { - CCoins &coins = pcoins->GetCoins(txin.prevout.hash); + const CCoins &coins = pcoins->GetCoins(txin.prevout.hash); assert(coins.IsAvailable(txin.prevout.n)); } // Check whether its inputs are marked in mapNextTx. @@ -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); } |