aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Handle incompatible BDB environmentsGavin Andresen2012-10-081-12/+7
|/ | | | | | | | | | 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.
* Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik2012-09-181-2/+2
|
* Removed duplicated lockxanatos2012-08-271-4/+1
| | | Around line 167 there is already a LOCK(bitdb.cs_db) that covers everything. Re-locking is useless.
* Run BDB disk-less for test_bitcoinLuke Dashjr2012-07-111-3/+50
|
* Merge pull request #1304 from rebroad/ShowBlockTimestampJeff Garzik2012-07-051-1/+3
|\ | | | | Show block timestamp
| * Show the timestamp for the block.R E Broadley2012-05-291-1/+3
| | | | | | | | wrap lines
* | Remove CTxDB::ReadOwnerTxes.Pieter Wuille2012-06-201-60/+0
|/ | | | It seems it wasn't ever used since 0.1.5.
* Refactor: add IsChainFile helper. LoadBlockIndex() code movement.Jeff Garzik2012-05-231-63/+81
|
* Merge branch 'dbenv' into tmpJeff Garzik2012-05-221-85/+97
|\ | | | | | | | | Conflicts: src/db.cpp
| * Further CDBEnv encapsulation work.Jeff Garzik2012-05-191-13/+11
| |
| * CDB::CDB: properly initialize activeTxn to NULLJeff Garzik2012-05-191-1/+2
| |
| * Remove unused nested BDB transaction supportJeff Garzik2012-05-191-3/+3
| |
| * Encapsulate BDB environment inside new CDBEnv classJeff Garzik2012-05-191-64/+77
| | | | | | | | | | | | | | | | Cleans up and organizes several scattered functions and variables related to the BDB env. Class CDBInit() existed to provide a guaranteed-via-C++-destructor cleanup of the db environment. A formal CDBEnv class provides all of this inside a single wrapper.
* | Prevent crashes due to missing or corrupted database recordsJeff Garzik2012-05-221-2/+14
| | | | | | | | | | | | | | Any problems seen during deserialization will throw an uncaught exception, crashing the entire bitcoin process. Properly return an error instead, so that we may at least log the error and gracefully shutdown other portions of the app.
* | BDB: restore DB_PRIVATE flag to environmentJeff Garzik2012-05-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Satoshi's commits fdbf76d and c8ad9b8 (SVN import) removed the DB_PRIVATE flag from the environment. In part, this enables processes other than bitcoind to examine the active database environment. However, this incurs a slight performance penalty versus working entirely within application memory (DB_PRIVATE). Because bitcointools and other direct-BDB-accessing tools are not used by the vast majority of users, prefer to default with DB_PRIVATE with the option of disabling it if needed via -privdb=0.
* | Merge pull request #1354 from fanquake/masterPieter Wuille2012-05-201-1/+1
|\ \ | |/ |/| Update Header Licenses
| * Update License in File HeadersFordy2012-05-181-1/+1
| | | | | | | | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.
* | Default to DB_TXN_WRITE_NOSYNC for all transactional operationsJeff Garzik2012-05-191-0/+1
|/ | | | | | | | | * This is safer than DB_TXN_NOSYNC, and does not appear to impact performance. * Applying this to the dbenv is necessary to avoid many fdatasync(2) calls on db 5.x * We carefully and thoroughly flush databases upon shutdown and other important events already.
* Report how long DBFlush took.R E Broadley2012-05-171-0/+2
|
* Merge pull request #1316 from jgarzik/dead-codeJeff Garzik2012-05-171-5/+0
|\ | | | | Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk()
| * Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk()Jeff Garzik2012-05-151-5/+0
| |
* | CAddrDB: Replace BDB-managed addr.dat with internally managed peers.datJeff Garzik2012-05-161-50/+79
|/
* Merge pull request #883 from sipa/loadblockGregory Maxwell2012-05-081-2/+2
|\ | | | | Add -loadblock to load from an external blk000?.dat file
| * -loadblock to load from an external blk000?.dat filePieter Wuille2012-04-221-2/+2
| |
* | Make lsn_reset ("detach databases") optional and off by default.Pieter Wuille2012-04-261-2/+7
| | | | | | | | | | | | | | | | | | | | Add an option -detachdb (and entry in OptionDialog), without which no lsn_reset is called on addr.dat and blkindex.dat. That means these files cannot be moved to a new environment, but shutdown can be significantly faster. The wallet file is always lsn_reset'ed. -detachdb corresponds to the old behaviour, though it is off by default now to speed up shutdowns.
* | Change signed->unsigned at 3 code sitesJeff Garzik2012-04-231-1/+1
|/ | | | This resolves signed/unsigned comparison warnings.
* Added ability to respond to signals during Block Loading stage.R E Broadley2012-04-181-2/+5
|
* Merge pull request #1114 from sipa/lesssyncPieter Wuille2012-04-171-0/+2
|\ | | | | Reduce sync frequency for blkindex.dat
| * Reduce sync frequency for blkindex.datPieter Wuille2012-04-171-0/+2
| | | | | | | | | | | | | | Since auto-remove-db-logs was enabled, each time a CTxDB was closed outside of the initial download window, it causes a checkpoint + log cleanup. This is overkill, so reduce the sync frequency to once per minute at most.
* | Further reduce header dependenciesPieter Wuille2012-04-171-9/+8
| | | | | | | | | | | | | | This commit removes the dependency of serialize.h on PROTOCOL_VERSION, and makes this parameter required instead of implicit. This is much saner, as it makes the places where changing a version number can have an influence obvious.
* | Move CWalletDB code to new walletdb module.Jeff Garzik2012-04-171-415/+3
| | | | | | | | | | In addition to standard code separation, this change opens the door to fixing several include inter-dependencies.
* | Remove headers.hPieter Wuille2012-04-171-2/+7
|/
* fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]Wladimir J. van der Laan2012-04-151-0/+4
|
* Use filesystem::path instead of manual string tinkeringPieter Wuille2012-04-111-14/+8
| | | | | | | | | | | | | | Where possible, use boost::filesystem::path instead of std::string or char* for filenames. This avoids a lot of manual string tinkering, in favor of path::operator/. GetDataDir is also reworked significantly, it now only keeps two cached directory names (the network-specific data dir, and the root data dir), which are decided through a parameter instead of pre-initialized global variables. Finally, remove the "upgrade from 0.1.5" case where a debug.log in the current directory has to be removed.
* Remove path.make_preferred() calls, and fix compiler error in bitcoinrpc RE: ↵Gavin Andresen2012-04-111-4/+0
| | | | boost::system
* Merge pull request #1052 from sipa/scopedlocksPieter Wuille2012-04-091-9/+14
|\ | | | | Use scoped locks instead of CRITICAL_BLOCK
| * Use scoped locks instead of CRITICAL_BLOCKPieter Wuille2012-04-091-9/+14
| |
* | updated db.cpp to use make_preferred()Philip Kaufmann2012-04-061-6/+10
|/
* Flush on log size instead of transaction countPieter Wuille2012-04-051-10/+1
|
* Merge pull request #1010 from sipa/fastblocks2Gavin Andresen2012-03-291-2/+12
|\ | | | | Use transactions-updated as flush condition
| * Use transactions-updated as flush conditionPieter Wuille2012-03-291-2/+12
| | | | | | | | | | The normal checkpointing during the block chain download is reduced to every five minutes only, but forced every 200000 updated transactions.
* | Workaround hangs when upgrading old addr.dat filesGavin Andresen2012-03-291-22/+11
|/
* Auto-remove logs, and decrease logfile size to 10MGavin Andresen2012-03-291-2/+3
|
* Use erase instead of rewrite to remove old addr entriesPieter Wuille2012-03-261-17/+11
|
* Merge branch 'checklevel' of https://github.com/sipa/bitcoinGavin Andresen2012-03-221-2/+97
|\
| * Add -checklevel and improve -checkblocksPieter Wuille2012-03-221-2/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -checkblocks now takes a numeric argument: the number of blocks that must be verified at the end of the chain. Default is 2500, and 0 means all blocks. -checklevel specifies how thorough the verification must be: 0: only check whether the block exists on disk 1: verify block validity (default) 2: verify transaction index validity 3: check transaction hashes 4: check whether spent txouts were spent within the main chain 5: check whether all prevouts are marked spent 6: check whether spent txouts were spent by a valid transaction that consumes them
* | Merge pull request #975 from sipa/versioncheckGavin Andresen2012-03-221-8/+8
|\ \ | | | | | | Check minversion before loading the rest of the wallet
| * | Check minversion before loading the rest of the walletPieter Wuille2012-03-221-8/+8
| |/ | | | | | | | | | | | | When a 0.6 wallet with compressed pubkeys is created, it writes a minversion record to prevent older clients from reading it. If the 0.5 loading it sees a key record before seeing the minversion record however, it will fail with DB_CORRUPT instead of DB_TOO_NEW.
* | Merge branch 'addrman' of https://github.com/sipa/bitcoinGavin Andresen2012-03-221-23/+48
|\ \
| * | CAddrMan: stochastic address managerPieter Wuille2012-02-241-23/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | Design goals: * Only keep a limited number of addresses around, so that addr.dat does not grow without bound. * Keep the address tables in-memory, and occasionally write the table to addr.dat. * Make sure no (localized) attacker can fill the entire table with his nodes/addresses. See comments in addrman.h for more detailed information.