aboutsummaryrefslogtreecommitdiff
path: root/src/txdb.h
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2013-01-20 18:05:34 +0100
committerPieter Wuille <[email protected]>2013-01-26 18:46:12 +0100
commitf369d02c51077ffa1644954d0478e93966e1bb72 (patch)
tree2d4d583878dae9762388a890a8d64d355d09ceef /src/txdb.h
parentMerge pull request #2213 from Diapolo/translations (diff)
downloaddiscoin-f369d02c51077ffa1644954d0478e93966e1bb72.tar.xz
discoin-f369d02c51077ffa1644954d0478e93966e1bb72.zip
Various performance tweaks to CCoinsView
* Pass txid's to CCoinsView functions by reference instead of by value * Add a method to swap CCoins, and use it in some places to avoid a allocating copy + destruct. * Optimize CCoinsViewCache::FetchCoins to do only a single search through the backing map.
Diffstat (limited to 'src/txdb.h')
-rw-r--r--src/txdb.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/txdb.h b/src/txdb.h
index ebac81b30..47496eddb 100644
--- a/src/txdb.h
+++ b/src/txdb.h
@@ -16,9 +16,9 @@ protected:
public:
CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
- bool GetCoins(uint256 txid, CCoins &coins);
- bool SetCoins(uint256 txid, const CCoins &coins);
- bool HaveCoins(uint256 txid);
+ bool GetCoins(const uint256 &txid, CCoins &coins);
+ bool SetCoins(const uint256 &txid, const CCoins &coins);
+ bool HaveCoins(const uint256 &txid);
CBlockIndex *GetBestBlock();
bool SetBestBlock(CBlockIndex *pindex);
bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);