aboutsummaryrefslogtreecommitdiff
path: root/src/coins.h
AgeCommit message (Collapse)Author
2015-11-02ModifyNewCoins saves database lookupsAlex Morcos
When processing a new transaction, in addition to spending the Coins of its txin's it creates a new Coins for its outputs. The existing ModifyCoins function will first make sure this Coins does not already exist. It can not exist due to BIP 30, but because of that the lookup can't be cached and always has to go to the database. Since we are creating the coins to match the new tx anyway, there is no point in checking if they exist first anyway. However this should not be used for coinbase tx's in order to preserve the historical behavior of overwriting the two existing duplicate tx pairs.
2015-07-20Separate core memory usage computation in core_memusage.hPieter Wuille
2015-05-11Keep track of memory usage in CCoinsViewCachePieter Wuille
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2015-01-02Merge pull request #5580Wladimir J. van der Laan
1b178a7 Bugfix: ConnectBlock: In case the genesis block gets in with fJustCheck, behave correctly (Luke Dashjr) 228d238 Make CCoinsViewCache's copy constructor private (Luke Dashjr)
2014-12-31Make CCoinsViewCache's copy constructor privateLuke Dashjr
It is easily confused with CCoinsViewCache(CCoinsView*), which creates a sub-cache, but instead of creating a sub-cache, the copy constructor would copy the original and use that original's base, defeating the intended isolation.
2014-12-27Decouple CCoins from CTxInUndojtimon
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-11-21Convert remaining comments in /src to doxygen formatMichael Ford
- Update comments in checkpoints to be doxygen compatible - Update comments in checkqueue to be doxygen compatible - Update coins to be doxygen compatible - Fix comment typo in crypter.h - Update licenses/copyright dates Closes #5325 #5184 #5183 #5182
2014-10-27MOVEONLY: Move script/compressor out of script and put CTxOutCompressor (fromjtimon
core) with it
2014-10-27MOVEONLY: separate CTxUndo out of corejtimon
2014-10-27MOVEONLY: Separate CTransaction and dependencies from corejtimon
2014-10-08Merge pull request #4834Pieter Wuille
7c70438 Get rid of the dummy CCoinsViewCache constructor arg (Pieter Wuille) ed27e53 Add coins_tests with a large randomized CCoinViewCache test. (Pieter Wuille) 058b08c Do not keep fully spent but unwritten CCoins entries cached. (Pieter Wuille) c9d1a81 Get rid of CCoinsView's SetCoins and SetBestBlock. (Pieter Wuille) f28aec0 Use ModifyCoins instead of mutable GetCoins. (Pieter Wuille)
2014-09-26Use a typedef for monetary valuesMark Friedenbach
2014-09-24Get rid of the dummy CCoinsViewCache constructor argPieter Wuille
2014-09-23Do not keep fully spent but unwritten CCoins entries cached.Pieter Wuille
Instead of storing CCoins entries directly in CCoinsMap, store a CCoinsCacheEntry which additionally keeps track of whether a particular entry is: * dirty: potentially different from its parent view. * fresh: the parent view is known to not have a non-pruned version. This allows us to skip non-dirty cache entries when pushing batches of changes up, and to remove CCoins entries about transactions that are fully spent before the parent cache learns about them.
2014-09-23Get rid of CCoinsView's SetCoins and SetBestBlock.Pieter Wuille
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.
2014-09-23Use ModifyCoins instead of mutable GetCoins.Pieter Wuille
Replace the mutable non-copying GetCoins method with a ModifyCoins, which returns an encapsulated iterator, so we can keep track of concurrent modifications (as iterators can be invalidated by those) and run cleanup code after a modification is finished. This also removes the overloading of the 'GetCoins' name.
2014-09-16Merge pull request #4825Pieter Wuille
8d657a6 Fixing compiler warning C4800: 'type' forcing value to bool 'true' or 'false' (ENikS)
2014-09-06Fixing compiler warning C4800: 'type' forcing value to bool 'true' or 'false'ENikS
2014-09-03Combine CCoinsViewCache's HaveCoins and const GetCoins into AccessCoins.Pieter Wuille
The efficient version of CCoinsViewCache::GetCoins only works for known-to-exist cache entries, requiring a separate HaveCoins call beforehand. This is inefficient as both perform a hashtable lookup. Replace the non-mutable GetCoins with AccessCoins, which returns a potentially-NULL pointer. This also decreases the overloading of GetCoins. Also replace some copying (inefficient) GetCoins calls with equivalent AccessCoins, decreasing the copying.
2014-08-28add missing header end commentsPhilip Kaufmann
- ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
2014-08-26Make appropriate getter-routines "const" in CCoinsView.Daniel Kraft
Mark the "Get"/"Have" routines in CCoinsView and subclasses as "const".
2014-08-24Allow BatchWrite to destroy its input, reducing copyingPieter Wuille
2014-08-07CCoinsKeyHasher::operator() should return size_tWladimir J. van der Laan
It currently returns uint64_t, which on older boost (at least 1.46) causes test failures on 32-bit systems. This problem was introduced in bc42503. Fixes #4634.
2014-07-14Use unordered_map for CCoinsViewCache with salted hashPieter Wuille
2014-07-01typedef std::map<uint256, CCoins> to CCoinsMapWladimir J. van der Laan
This makes it possible to switch to a more efficient map type without changing all occurences manually. Merges half of #4413.
2013-11-30Add verbose boolean to getrawmempoolGavin Andresen
Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
2013-11-30Refactor: move GetValueIn(tx) to tx.GetValueIn()Gavin Andresen
GetValueIn makes more sense as a CTransaction member.
2013-11-10Move CCoins-related logic to coins.{cpp.h}Pieter Wuille