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.
This commit is contained in:
12
src/txdb.cpp
12
src/txdb.cpp
@@ -33,12 +33,6 @@ bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) const {
|
||||
return db.Read(make_pair('c', txid), coins);
|
||||
}
|
||||
|
||||
bool CCoinsViewDB::SetCoins(const uint256 &txid, const CCoins &coins) {
|
||||
CLevelDBBatch batch;
|
||||
BatchWriteCoins(batch, txid, coins);
|
||||
return db.WriteBatch(batch);
|
||||
}
|
||||
|
||||
bool CCoinsViewDB::HaveCoins(const uint256 &txid) const {
|
||||
return db.Exists(make_pair('c', txid));
|
||||
}
|
||||
@@ -50,12 +44,6 @@ uint256 CCoinsViewDB::GetBestBlock() const {
|
||||
return hashBestChain;
|
||||
}
|
||||
|
||||
bool CCoinsViewDB::SetBestBlock(const uint256 &hashBlock) {
|
||||
CLevelDBBatch batch;
|
||||
BatchWriteHashBestChain(batch, hashBlock);
|
||||
return db.WriteBatch(batch);
|
||||
}
|
||||
|
||||
bool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) {
|
||||
LogPrint("coindb", "Committing %u changed transactions to coin database...\n", (unsigned int)mapCoins.size());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user