diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-02-22 09:01:30 -0800 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-02-22 09:01:30 -0800 |
commit | cc67f1e2b40950749637a14aa4a623731aee8eb7 (patch) | |
tree | 59c025e589bc3857bb639e99221fff72fc703e6b /src/txdb.cpp | |
parent | b8f4e42e1bd9f80690d61dc2ab86edb14b2ecb40 (diff) | |
parent | f369d02c51077ffa1644954d0478e93966e1bb72 (diff) |
Merge pull request #2221 from sipa/perfo
Various performance tweaks to CCoinsView
Diffstat (limited to 'src/txdb.cpp')
-rw-r--r-- | src/txdb.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp index 8c01158254..ae7aceb7f1 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -22,17 +22,17 @@ void static BatchWriteHashBestChain(CLevelDBBatch &batch, const uint256 &hash) { CCoinsViewDB::CCoinsViewDB(size_t nCacheSize, bool fMemory, bool fWipe) : db(GetDataDir() / "chainstate", nCacheSize, fMemory, fWipe) { } -bool CCoinsViewDB::GetCoins(uint256 txid, CCoins &coins) { +bool CCoinsViewDB::GetCoins(const uint256 &txid, CCoins &coins) { return db.Read(make_pair('c', txid), coins); } -bool CCoinsViewDB::SetCoins(uint256 txid, const CCoins &coins) { +bool CCoinsViewDB::SetCoins(const uint256 &txid, const CCoins &coins) { CLevelDBBatch batch; BatchWriteCoins(batch, txid, coins); return db.WriteBatch(batch); } -bool CCoinsViewDB::HaveCoins(uint256 txid) { +bool CCoinsViewDB::HaveCoins(const uint256 &txid) { return db.Exists(make_pair('c', txid)); } |