aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
AgeCommit message (Collapse)Author
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
2012-10-09Merge branch 'wallet_exceptions' of github.com:gavinandresen/bitcoin-gitGavin Andresen
2012-10-08Revert "Send 'mempool' P2P command at the start of each P2P session"Jeff Garzik
Fat-fingered on github, and merged this too early. This reverts commit 22f9b069035c9ba0416a62714db167eea5ba762f.
2012-10-08Merge pull request #1833 from jgarzik/mempool-queryJeff Garzik
Send 'mempool' P2P command at the start of each P2P session
2012-10-08Don't try to verify a non-existent wallet.datGavin Andresen
2012-10-08Handle corrupt wallets gracefully.Gavin Andresen
Corrupt wallets used to cause a DB_RUNRECOVERY uncaught exception and a crash. This commit does three things: 1) Runs a BDB verify early in the startup process, and if there is a low-level problem with the database: + Moves the bad wallet.dat to wallet.timestamp.bak + Runs a 'salvage' operation to get key/value pairs, and writes them to a new wallet.dat + Continues with startup. 2) Much more tolerant of serialization errors. All errors in deserialization are reported by tolerated EXCEPT for errors related to reading keypairs or master key records-- those are reported and then shut down, so the user can get help (or recover from a backup). 3) Adds a new -salvagewallet option, which: + Moves the wallet.dat to wallet.timestamp.bak + extracts ONLY keypairs and master keys into a new wallet.dat + soft-sets -rescan, to recreate transaction history This was tested by randomly corrupting testnet wallets using a little python script I wrote (https://gist.github.com/3812689)
2012-10-08Handle incompatible BDB environmentsGavin Andresen
Before, opening a -datadir that was created with a new version of Berkeley DB would result in an un-caught DB_RUNRECOVERY exception. After these changes, the error is caught and the user is told that there is a problem and is told how to try to recover from it.
2012-10-08Merge branch 'BDB_DOWNGRADE'Gavin Andresen
2012-10-08Handle incompatible BDB environmentsGavin Andresen
Before, opening a -datadir that was created with a new version of Berkeley DB would result in an un-caught DB_RUNRECOVERY exception. After these changes, the error is caught and the user is told that there is a problem and is told how to try to recover from it.
2012-10-04Send --help message to stdout i.s.o stderrWladimir J. van der Laan
This allows fun stuff such as `bitcoin --help | less`, and more easy piping to files. Looking at other tools such as bash, gcc, they all send their help text to stdout.
2012-10-01fix -Wformat warnings all over the sourcePhilip Kaufmann
2012-09-28Merge pull request #1862 from kjj2/testportsPieter Wuille
Fix: when testnet=1 specified, change default RPC port to 18332
2012-09-24Fix: when testnet=1 specified, change default ports to 18332 and 18333kjj2
2012-09-24Send 'mempool' P2P command at the start of each P2P sessionJeff Garzik
to query remote node mempool contents.
2012-09-24Import $DataDir/bootstrap.dat automatically, if it exists.Jeff Garzik
As discussed on IRC. Intended to make using an external blockchain download solution just a bit easier.
2012-09-06Fix double-paren typoGavin Andresen
2012-09-05remove double logging of startup time, when !fLogTimestampsPhilip Kaufmann
2012-09-04init.cpp: fix build error, and possibly-uninit'd warningJeff Garzik
2012-09-04Merge pull request #1427 from rebroad/StartTimeFixJeff Garzik
No need to log start time if it's already being done on every line.
2012-09-04Merge pull request #1738 from laanwj/2012_08_boostthreadJeff Garzik
implement CreateThread with boost::thread
2012-09-01No need to log start time if it's already being done on every line.R E Broadley
2012-08-30add default value in -timeout descriptionPhilip Kaufmann
2012-08-29Rename CreateThread to NewThreadWladimir J. van der Laan
Prevent clash with win32 API symbol
2012-08-23Allow building with IPv6 support, but it disabled by defaultLuke Dashjr
2012-08-22Fix infinite loops in connection logicPieter Wuille
2012-08-17add splashscreen message when importing blocks via -loadblockPhilip Kaufmann
2012-08-03Bitcoin-Qt (Windows only): enable DEP for bitcoin-qt.exePhilip Kaufmann
- this enables DEP on all Windows version which support the SetProcessDEPPolicy() call in Kernel32.dll - use a dynamic approach via GetProcAddress() to not rely on headers or compiler libs - this is the same way the Tor-project does it
2012-08-01Merge pull request #1632 from luke-jr/spellingJeff Garzik
Fix spelling and grammar errors
2012-08-01Bugfix: Correct English grammar regarding "'s"Luke Dashjr
2012-08-01Bugfix: Fix a variety of misspellingsLuke Dashjr
2012-08-01Update Warning-strings to use a standard-formatPhilip Kaufmann
- ensure warnings always start with "Warning:" and that the first character after ":" is written uppercase - ensure the first sentence in warnings ends with an "!" - remove unneeded spaces from Warning-strings - add missing Warning-string translation - remove a "\n" and replace with untranslatable "<br><br>"
2012-08-01Merge pull request #1465 from Diapolo/NOUI_showSSLVersionJeff Garzik
write used OpenSSL library version to debug.log
2012-08-01Merge pull request #1396 from rebroad/NoShrinkOptionJeff Garzik
Make truncating the debug.log file an option.
2012-07-27update HelpMessage()Philip Kaufmann
- place "-?" option at first - re-work description and "\n" usage for Gavins new block creation options to better match current description syntax - ensure no "\n" is in translated strings, which is better for Transifex
2012-07-26When creating new blocks, sort 'paid' area by fee-per-kbGavin Andresen
Modify CreateNewBlock so that instead of processing all transactions in priority order, process the first 27K of transactions in priority order and then process the rest in fee-per-kilobyte order. This is the first, minimal step towards better a better fee-handling system for both miners and end-users; this patch should be easy to backport to the old versions of Bitcoin, and accomplishes the most important goal-- allow users to "buy their way in" to blocks using transaction fees.
2012-07-17Give threads a recognisable name to aid in debuggingGiel van Schijndel
NOTE: These thread names are visible in gdb when using 'info threads'. Additionally both 'top' and 'ps' show these names *unless* told to display the command-line instead of task name. Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-07-04write used OpenSSL library version to debug.logPhilip Kaufmann
2012-07-01Change default send buffer to 1Mb.Matt Corallo