aboutsummaryrefslogtreecommitdiff
path: root/src/coins.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2014-09-03 09:25:32 +0200
committerPieter Wuille <[email protected]>2014-09-23 22:29:21 +0200
commitc9d1a81ce76737a73c9706e074a4fe8440c8277e (patch)
treee0632f5b7e27ff788ecfef97e0bfd7d31ef12b21 /src/coins.cpp
parentUse ModifyCoins instead of mutable GetCoins. (diff)
downloaddiscoin-c9d1a81ce76737a73c9706e074a4fe8440c8277e.tar.xz
discoin-c9d1a81ce76737a73c9706e074a4fe8440c8277e.zip
Get rid of CCoinsView's SetCoins and SetBestBlock.
All direct modifications are now done through ModifyCoins, and BatchWrite is used for pushing batches of queued modifications up, so we don't need the low-level SetCoins and SetBestBlock anymore in the top-level CCoinsView class.
Diffstat (limited to 'src/coins.cpp')
-rw-r--r--src/coins.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/coins.cpp b/src/coins.cpp
index 2b93c74c3..9632e67f2 100644
--- a/src/coins.cpp
+++ b/src/coins.cpp
@@ -53,20 +53,16 @@ bool CCoins::Spend(int nPos) {
bool CCoinsView::GetCoins(const uint256 &txid, CCoins &coins) const { return false; }
-bool CCoinsView::SetCoins(const uint256 &txid, const CCoins &coins) { return false; }
bool CCoinsView::HaveCoins(const uint256 &txid) const { return false; }
uint256 CCoinsView::GetBestBlock() const { return uint256(0); }
-bool CCoinsView::SetBestBlock(const uint256 &hashBlock) { return false; }
bool CCoinsView::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; }
bool CCoinsView::GetStats(CCoinsStats &stats) const { return false; }
CCoinsViewBacked::CCoinsViewBacked(CCoinsView &viewIn) : base(&viewIn) { }
bool CCoinsViewBacked::GetCoins(const uint256 &txid, CCoins &coins) const { return base->GetCoins(txid, coins); }
-bool CCoinsViewBacked::SetCoins(const uint256 &txid, const CCoins &coins) { return base->SetCoins(txid, coins); }
bool CCoinsViewBacked::HaveCoins(const uint256 &txid) const { return base->HaveCoins(txid); }
uint256 CCoinsViewBacked::GetBestBlock() const { return base->GetBestBlock(); }
-bool CCoinsViewBacked::SetBestBlock(const uint256 &hashBlock) { return base->SetBestBlock(hashBlock); }
void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; }
bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); }
bool CCoinsViewBacked::GetStats(CCoinsStats &stats) const { return base->GetStats(stats); }
@@ -124,11 +120,6 @@ const CCoins* CCoinsViewCache::AccessCoins(const uint256 &txid) const {
}
}
-bool CCoinsViewCache::SetCoins(const uint256 &txid, const CCoins &coins) {
- cacheCoins[txid] = coins;
- return true;
-}
-
bool CCoinsViewCache::HaveCoins(const uint256 &txid) const {
CCoinsMap::const_iterator it = FetchCoins(txid);
// We're using vtx.empty() instead of IsPruned here for performance reasons,
@@ -144,9 +135,8 @@ uint256 CCoinsViewCache::GetBestBlock() const {
return hashBlock;
}
-bool CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) {
+void CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) {
hashBlock = hashBlockIn;
- return true;
}
bool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlockIn) {