aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-08-26 16:47:44 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-08-26 16:49:02 +0200
commit790911ff0a659becd983afd5309b2c16401ba28d (patch)
tree0e8013882018d752e12b86de7f854cfb30143d19 /src/txmempool.cpp
parent0d763fc9e148f753cff19daea23866f139ad0a7f (diff)
parentd0867acb0e07ac63f03dcc555387f24322e8799e (diff)
downloadbitcoin-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.cpp8
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);
}