aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
AgeCommit message (Collapse)Author
2013-01-30Deal with LevelDB errorsPieter Wuille
2013-01-30CValidationState frameworkPieter Wuille
2013-01-26Check only 288 blocks at startup by defaultPieter Wuille
2013-01-25Merge pull request #2168 from sipa/txindexGavin Andresen
Add optional transaction index to databases
2013-01-19Merge pull request #2171 from Diapolo/initWladimir J. van der Laan
add InitMessage() to noui and use debug.log for GUI
2013-01-18Add optional transaction index to databasesPieter Wuille
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-17Merge pull request #2060 from sipa/parallelGavin Andresen
Parallel script verification
2013-01-14Merge pull request #2172 from Diapolo/init_messagesGavin Andresen
make database init messages more valuable
2013-01-14Merge pull request #2099 from gavinandresen/blkfile_upgradeGavin Andresen
Upgrading to 0.8: re-use blkNNNN.dat files.
2013-01-13make database init messages more valuablePhilip Kaufmann
- it was bad, that quite some messages were just talking about a database, I think a user should know, if we are talking about wallet db or block/coin db - also adds a new init message for "Verifying block database integrity..."
2013-01-11add InitMessage() to noui and use debug.log for GUIPhilip Kaufmann
- this pull adds an InitMessage() function to noui.cpp, which outputs init messages to debug.log (this allows to remove some printf() calls from init.cpp) - change InitMessage() in bitcoin.cpp to also write init messages to debug.log to ensure nothting is missing in the log because of the removal of printf() calls in init.cpp
2013-01-08Parallelize script verificationPieter Wuille
* During block verification (when parallelism is requested), script check actions are stored instead of being executed immediately. * After every processed transactions, its signature actions are pushed to a CScriptCheckQueue, which maintains a queue and some synchronization mechanism. * Two or more threads (if enabled) start processing elements from this queue, * When the block connection code is finished processing transactions, it joins the worker pool until the queue is empty. As cs_main is held the entire time, and all verification must be finished before the block continues processing, this does not reach the best possible performance. It is a less drastic change than some more advanced mechanisms (like doing verification out-of-band entirely, and rolling back blocks when a failure is detected). The -par=N flag controls the number of threads (1-16). 0 means auto, and is the default.
2013-01-04New database check routinePieter Wuille
-checklevel gets a new meaning: 0: verify blocks can be read from disk (like before) 1: verify (contextless) block validity (like before) 2: verify undo files can be read and have good checksums 3: verify coin database is consistent with the last few blocks (close to level 6 before) 4: verify all validity rules of the last few blocks Level 3 is the new default, as it's reasonably fast. As level 3 and 4 are implemented using an in-memory rollback of the database, they are limited to as many blocks as possible without exceeding the limits set by -dbcache. The default of -dbcache=25 allows for some 150-200 blocks to be rolled back. In case an error is found, the application quits with a message instructing the user to restart with -reindex. Better instructions, and automatic recovery (when possible) or automatic reindexing are left as future work.
2013-01-01Remove 'T' from remaining date/time format strings.Jeff Garzik
2012-12-28update 2 command-line parameter help messagesPhilip Kaufmann
- -checkpoints is now much more understandable and should be way easier to translate - -loadblock uses the same format (blk000??.dat) as -reindex
2012-12-16Upgrading to 0.8: re-use blkNNNN.dat files.Gavin Andresen
2012-12-13Merge pull request #2096 from 94m3k1n9/fix-time-formatsPieter Wuille
Change timestamps to use ISO8601 formatting
2012-12-12Merge pull request #2048 from jgarzik/no-checkpointsGavin Andresen
Add "checkpoints" option, to permit disabling of checkpoint logic.
2012-12-12Merge pull request #2059 from sipa/benchmarkGavin Andresen
Add -benchmark for reporting block processing times
2012-12-12Merge pull request #2062 from sipa/nocoinsGavin Andresen
Reconstruct coins/ database when missing
2012-12-12Change timestamps to use ISO8601 formattingRichard Schwab
2012-12-06Allow lengthy block reconnections to be interruptedPieter Wuille
When the coin database is out of date with the block database, the best block in it is automatically switched to. This reconnection process can take time, so allow it to be interrupted. This also stops block connection as soon as shutdown is requested, leading to a faster shutdown.
2012-12-06Reconstruct coins/ from scratch when missing.Pieter Wuille
2012-12-05Add -benchmark for reporting block processing timesPieter Wuille
2012-12-03add 2 constructors in CDiskBlockPos to simplify class usagePhilip Kaufmann
- add a default-constructor, which simply calls SetNull() and a constructor to directly pass nFile and nPos - change code to use that new constructors
2012-11-28Add "checkpoints" option, to permit disabling of checkpoint logic.Jeff Garzik
2012-11-26update CClientUIInterface and remove orphan Wx stuffPhilip Kaufmann
- fix ThreadSafeMessageBox always displays error icon - allow to specify MSG_ERROR / MSG_WARNING or MSG_INFORMATION without a custom caption / title - allow to specify CClientUIInterface::ICON_ERROR / ICON_WARNING and ICON_INFORMATION (which is default) as message box icon - remove CClientUIInterface::OK from ThreadSafeMessageBox-calls, as the OK button will be set as default, if none is specified - prepend "Bitcoin - " to used captions - rename BitcoinGUI::error() -> BitcoinGUI::message() and add function documentation - change all style parameters and enum flags to unsigned - update code to use that new API - update Client- and WalletModel to use new BitcoinGUI::message() and rename the classes error() method into message() - include the possibility to supply the wanted icon for messages from Client- and WalletModel via "style" parameter
2012-11-14make enum and parameter used in Bind() unsignedPhilip Kaufmann
- it's good practise to use unsigned int for enum flags, so change this one, as I introduced this for Bind()
2012-11-10allow listening on -bind=address for blocked networksPhilip Kaufmann
- this allows the client to listen on via -bind specified addresses (e.g. 127.0.0.1), even when a network (IPv4 in that case) was blocked via e.g -onlynet="Tor" - introduce enum BindFlags to avoid passing multiple bools to Bind() - make -bind help text clear we ALWAYS listen on the specified address - remove an unused variable - remove 2 unneeded IsLimited() checks before calling Bind(), which does these checks anyway - usage case: specify -bind=127.0.0.1 -onlynet="Tor" to allow incoming connections to a Tor hidden service, but still don't allow other IPv4 nodes to connect / get connected
2012-11-09Merge pull request #1943 from sipa/reindex2Pieter Wuille
Add -reindex, to perform in-place reindexing of block chain files
2012-11-09Merge pull request #1978 from sipa/nodetachPieter Wuille
Remove -detachdb and stop's detach argument.
2012-11-09Add -reindex, to perform in-place reindexing of block chain filesPieter Wuille
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-09Move ThreadImport to init.cppPieter Wuille
2012-11-08Merge pull request #1981 from sipa/cachesPieter Wuille
Cache size optimizations
2012-11-04Cache size optimizationsPieter Wuille
2012-11-04Remove -detachdb and stop's detach argument.Pieter Wuille
As the only BDB database left is the wallet, and it is always detached. Also remove IsChainFile() predicate and related chainfile-specific logic.
2012-10-25fix some double-spaces in stringsPhilip Kaufmann
- remove some unneeded stuff in sendcoinsentry.ui - harmonize some "Error:"-messages
2012-10-25First flush block tree, then coin setPieter Wuille
As the coinset data refers to the best block, stored in the block tree. Flushing the coin set first can cause inconsistencies if the process gets killed in between.
2012-10-25Added checks for null pointers in Shutdowntucenaber
Estetics
2012-10-21change blockchain -> block chain (spelling)Philip Kaufmann
- Wiki says "block chain" is correct ;) - remove some unneeded spaces I found in the source, while fixing the spelling
2012-10-20Add LevelDB MemEnv supportPieter Wuille
Support LevelDB memory-backed environments, and use them in unit tests.
2012-10-20LevelDB block and coin databasesPieter Wuille
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-20Use singleton block tree database instancePieter Wuille
2012-10-20Prepare database format for multi-stage block processingPieter Wuille
This commit adds a status field and a transaction counter to the block indexes.
2012-10-20Automatically reorganize at startup to best known blockPieter Wuille
Given that the block tree database (chain.dat) and the active chain database (coins.dat) are entirely separate now, it becomes legal to swap one with another instance without affecting the other. This commit introduces a check in the startup code that detects the presence of a better chain in chain.dat that has not been activated yet, and does so efficiently (in batch, while reusing the blk???.dat files).
2012-10-20Batch block connection during IBDPieter Wuille
During the initial block download (or -loadblock), delay connection of new blocks a bit, and perform them in a single action. This reduces the load on the database engine, as subsequent blocks often update an earlier block's transaction already.
2012-10-20UltraprunePieter Wuille
This switches bitcoin's transaction/block verification logic to use a "coin database", which contains all unredeemed transaction output scripts, amounts and heights. The name ultraprune comes from the fact that instead of a full transaction index, we only (need to) keep an index with unspent outputs. For now, the blocks themselves are kept as usual, although they are only necessary for serving, rescanning and reorganizing. The basic datastructures are CCoins (representing the coins of a single transaction), and CCoinsView (representing a state of the coins database). There are several implementations for CCoinsView. A dummy, one backed by the coins database (coins.dat), one backed by the memory pool, and one that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock, DisconnectBlock, ... now operate on a generic CCoinsView. The block switching logic now builds a single cached CCoinsView with changes to be committed to the database before any changes are made. This means no uncommitted changes are ever read from the database, and should ease the transition to another database layer which does not support transactions (but does support atomic writes), like LevelDB. For the getrawtransaction() RPC call, access to a txid-to-disk index would be preferable. As this index is not necessary or even useful for any other part of the implementation, it is not provided. Instead, getrawtransaction() uses the coin database to find the block height, and then scans that block to find the requested transaction. This is slow, but should suffice for debug purposes.
2012-10-20Move external block import to separate threadPieter Wuille
2012-10-12Fix a use-after-free problem in initialization (#1920)Wladimir J. van der Laan
Don't store the result of c_str(). Luckily, this only affects logging, though it could crash or leak sensitive data to the log in rare cases.
2012-10-09Fix bad merge, pszDataDir duplicationGavin Andresen