Commit graph

39 commits

Author SHA1 Message Date
Alex Morcos 0e5133cb2e
Make threshold for flushing more conservative.
Always leave a reasonable buffer of 50MB for usage from newly connected block (once over 50%) and increase the high water mark buffer to 200MB.

Github-Pull: #10133
Rebased-From: 1b55e07b7a
2017-04-05 08:23:02 +02:00
Alex Morcos d6867689d1
Lower default memory footprint slightly
Github-Pull: #10133
Rebased-From: f33afd3b2b
2017-04-05 08:23:01 +02:00
Alex Morcos ab864d3e49
Make pcoinsTip memory calculations consistent
Since we are more accurately measuring pcoinsTip peak usage at twice the current in dynamic usage, it makes sense to double the default (this will lead to the same effective usage and peak usage as previously).
We should also double the buffer used to avoid flushing if above 90% but still sufficient space remaining.

Github-Pull: #10133
Rebased-From: 5b95a190e8
2017-04-05 08:23:01 +02:00
isle2983 27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Pieter Wuille 528472111b Get rid of nType and nVersion
Remove the nType and nVersion as parameters to all serialization methods
and functions. There is only one place where it's read and has an impact
(in CAddress), and even there it does not impact any of the recursively
invoked serializers.

Instead, the few places that need nType or nVersion are changed to read
it directly from the stream object, through GetType() and GetVersion()
methods which are added to all stream classes.
2016-11-07 13:56:27 -08:00
Jorge Timón cdd79eb70f C++11: s/boost::scoped_ptr/std::unique_ptr/ 2016-09-01 19:05:07 +02:00
Wladimir J. van der Laan 32cab91278 Bump -dbcache default to 300MiB
Also cap the allocation for the leveldb-specific cache for the UTXO set
to 8MiB.
This avoids that the extra cache memory goes to the much less effective
leveldb cache instead of our application-level cache.
2016-07-06 07:44:51 +02:00
Wladimir J. van der Laan 99e70751f2 Break circular dependency main ↔ txdb
Break the circular dependency between main and txdb by:

- Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes
  sense, as the other block-file stuff is there too.

- Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems
  specific to txdb.

- Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves
  it up to the caller how to insert block indices.
2016-04-15 17:48:38 +02:00
Wladimir J. van der Laan 509cb006d5 txdb: Add Cursor() method to CCoinsView to iterate over UTXO set
Add a method Cursor() to CCoinsView that returns a cursor which can be
used to iterate over the whole UTXO set.

- rpc: Change gettxoutsetinfo to use new Cursor method

- txdb: Remove GetStats method - Now that GetStats is implemented in
  terms of Cursor, remove it.
2016-04-15 16:33:05 +02:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
Jeff Garzik 3795e8152b leveldbwrapper file rename to dbwrapper.* 2015-10-22 21:33:06 -04:00
Jeff Garzik 8587b23038 leveldbwrapper symbol rename: Remove "Level" from class, etc. names 2015-10-22 21:02:20 -04:00
Pieter Wuille b3ed4236be Cache tweak and logging improvements 2015-05-11 17:58:14 -07:00
Michael Ford 63e4c9cd35 Fix clang compile warnings intriduced in #5681 2015-03-29 19:45:05 +08:00
Jorge Timón 8a893c949b Includes: Do not include main.h from any other header 2015-03-24 17:23:32 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Pieter Wuille 63d1ae5556 Do all block index writes in a batch 2014-11-25 16:26:35 +01:00
Michael Ford fa94b9d562
Convert remaining comments in /src to doxygen format
- 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-11-21 14:44:21 +01:00
Pavel Janík 84738627ce Fix all header defines 2014-11-03 16:16:40 +01:00
Pieter Wuille c9d1a81ce7 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.
2014-09-23 22:29:21 +02:00
Daniel Kraft a3dc587a62 Make appropriate getter-routines "const" in CCoinsView.
Mark the "Get"/"Have" routines in CCoinsView and subclasses as "const".
2014-08-26 11:29:18 +02:00
Pieter Wuille b0875eb3fe Allow BatchWrite to destroy its input, reducing copying 2014-08-24 02:08:33 +02:00
Wladimir J. van der Laan dd638dd712
typedef std::map<uint256, CCoins> to CCoinsMap
This makes it possible to switch to a more efficient map type
without changing all occurences manually.

Merges half of #4413.
2014-07-01 12:48:16 +02:00
Pieter Wuille df9eb5e14f Move {Get,Set}Compact from bignum to uint256 2014-05-09 16:44:59 +02:00
Wladimir J. van der Laan ad54a9b83f Change new constants in txdb.h to int64_t
A shift overflow was happening when using these to check against in init.cpp.
Fixes #3702.
2014-02-18 17:13:32 +01:00
Philip Kaufmann 82e96006ae add constants for shared (GUI/core) -dbcache settings
- adds nDefaultDbCache, nMaxDbCache and nMinDbCache in txdb.h
2014-02-17 15:44:21 +01:00
Pieter Wuille 84674082b0 Make CCoinsView use block hashes instead of indices 2013-11-10 19:22:53 +01:00
Brandon Dahler 51ed9ec971 Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
2013-11-10 09:36:28 -06:00
Brandon Dahler b64187d05f Rename leveldb.{h,cpp} to leveldbwrapper.{h,cpp}. 2013-11-08 18:03:46 -06:00
Pieter Wuille 85eb2cef33 Do not use the redundant BestInvalidWork record in the block database.
As block index entries have a flag for marking invalid blocks, the
'best invalid work' information can be derived from there. In addition,
remove the global from main.h
2013-11-01 00:54:28 +01:00
super3 db0e8ccd90 Bump Year Number to 2013 2013-10-20 15:25:06 -04:00
Gavin Andresen cc67f1e2b4 Merge pull request #2221 from sipa/perfo
Various performance tweaks to CCoinsView
2013-02-22 09:01:30 -08:00
Pieter Wuille 8fdc94cc8f Rename database directories 2013-01-28 21:08:05 +01:00
Pieter Wuille f369d02c51 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.
2013-01-26 18:46:12 +01:00
Pieter Wuille 2d1fa42e85 Add optional transaction index to databases
By specifying -txindex when initializing the database, a txid-to-diskpos
index is maintained in the blktree database. This database is used to
help answering getrawtransaction() RPC queries, when enabled.

Changing the -txindex value requires a -reindex; the client will abort
at startup if the database and the specified -txindex mismatch.
2013-01-18 14:39:11 +01:00
Pieter Wuille 7fea484674 Add -reindex, to perform in-place reindexing of block chain files
Flushes the blktree/ and coins/ databases, and reindexes the
block chain files, as if their contents was loaded via -loadblock.

Based on earlier work by Jeff Garzik.
2012-11-09 01:06:32 +01:00
Pieter Wuille 1c83b0a377 Cache size optimizations 2012-11-04 18:06:25 +01:00
Pieter Wuille 4ca60bba5c Remove BDB block database support 2012-10-20 23:08:57 +02:00
Pieter Wuille 2d8a48292b LevelDB block and coin databases
Split off CBlockTreeDB and CCoinsViewDB into txdb-*.{cpp,h} files,
implemented by either LevelDB or BDB.

Based on code from earlier commits by Mike Hearn in his leveldb
branch.
2012-10-20 23:08:57 +02:00