aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
AgeCommit message (Collapse)Author
2012-06-20Remove CTxDB::ReadOwnerTxes.Pieter Wuille
It seems it wasn't ever used since 0.1.5.
2012-05-23Refactor: add IsChainFile helper. LoadBlockIndex() code movement.Jeff Garzik
2012-05-22Merge branch 'dbenv' into tmpJeff Garzik
Conflicts: src/db.cpp
2012-05-22Prevent crashes due to missing or corrupted database recordsJeff Garzik
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.
2012-05-21BDB: restore DB_PRIVATE flag to environmentJeff Garzik
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.
2012-05-20Merge pull request #1354 from fanquake/masterPieter Wuille
Update Header Licenses
2012-05-19Further CDBEnv encapsulation work.Jeff Garzik
2012-05-19CDB::CDB: properly initialize activeTxn to NULLJeff Garzik
2012-05-19Remove unused nested BDB transaction supportJeff Garzik
2012-05-19Encapsulate BDB environment inside new CDBEnv classJeff Garzik
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.
2012-05-19Default to DB_TXN_WRITE_NOSYNC for all transactional operationsJeff Garzik
* 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.
2012-05-18Update License in File HeadersFordy
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.
2012-05-17Report how long DBFlush took.R E Broadley
2012-05-17Merge pull request #1316 from jgarzik/dead-codeJeff Garzik
Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk()
2012-05-16CAddrDB: Replace BDB-managed addr.dat with internally managed peers.datJeff Garzik
2012-05-15Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk()Jeff Garzik
2012-05-08Merge pull request #883 from sipa/loadblockGregory Maxwell
Add -loadblock to load from an external blk000?.dat file
2012-04-26Make lsn_reset ("detach databases") optional and off by default.Pieter Wuille
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.
2012-04-23Change signed->unsigned at 3 code sitesJeff Garzik
This resolves signed/unsigned comparison warnings.
2012-04-22-loadblock to load from an external blk000?.dat filePieter Wuille
2012-04-18Added ability to respond to signals during Block Loading stage.R E Broadley
2012-04-17Merge pull request #1114 from sipa/lesssyncPieter Wuille
Reduce sync frequency for blkindex.dat
2012-04-17Further reduce header dependenciesPieter Wuille
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.
2012-04-17Move CWalletDB code to new walletdb module.Jeff Garzik
In addition to standard code separation, this change opens the door to fixing several include inter-dependencies.
2012-04-17Remove headers.hPieter Wuille
2012-04-17Reduce sync frequency for blkindex.datPieter Wuille
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.
2012-04-15fix warnings: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]Wladimir J. van der Laan
2012-04-11Use filesystem::path instead of manual string tinkeringPieter Wuille
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.
2012-04-11Remove path.make_preferred() calls, and fix compiler error in bitcoinrpc RE: ↵Gavin Andresen
boost::system
2012-04-09Merge pull request #1052 from sipa/scopedlocksPieter Wuille
Use scoped locks instead of CRITICAL_BLOCK
2012-04-09Use scoped locks instead of CRITICAL_BLOCKPieter Wuille
2012-04-06updated db.cpp to use make_preferred()Philip Kaufmann
2012-04-05Flush on log size instead of transaction countPieter Wuille
2012-03-29Merge pull request #1010 from sipa/fastblocks2Gavin Andresen
Use transactions-updated as flush condition
2012-03-29Use transactions-updated as flush conditionPieter Wuille
The normal checkpointing during the block chain download is reduced to every five minutes only, but forced every 200000 updated transactions.
2012-03-29Workaround hangs when upgrading old addr.dat filesGavin Andresen
2012-03-29Auto-remove logs, and decrease logfile size to 10MGavin Andresen
2012-03-26Use erase instead of rewrite to remove old addr entriesPieter Wuille
2012-03-22Merge branch 'checklevel' of https://github.com/sipa/bitcoinGavin Andresen
2012-03-22Merge pull request #975 from sipa/versioncheckGavin Andresen
Check minversion before loading the rest of the wallet
2012-03-22Merge branch 'addrman' of https://github.com/sipa/bitcoinGavin Andresen
2012-03-22Check minversion before loading the rest of the walletPieter Wuille
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.
2012-03-22Add -checklevel and improve -checkblocksPieter Wuille
-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
2012-03-21Speed up block downloadingPieter Wuille
2012-03-12Print more diagnostic info for the various DB_CORRUPT conditionsLuke Dashjr
2012-02-26bitcoind changes to stop storing settings in wallet.dat.Gavin Andresen
2012-02-25Fix addrProxy settingPieter Wuille
Before 0.6 addrProxy was a CAddress, but netbase changed it to CService. Retain compatibility by wrapping/unwrapping with a CAddress when saving or loading. This commit retains compatibility with 0.6.0rc1 (which wrote the setting as a CService) by trying to parse twice.
2012-02-24CAddrMan: stochastic address managerPieter Wuille
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.
2012-02-18Add SetMinVersion to CWalletPieter Wuille
2012-02-15Added 'Backup Wallet' menu optionsje397
- icon from the LGPL Nuvola set (like the tick) - http://www.icon-king.com/projects/nuvola/ - include 'boost/version.hpp' in db.cpp so that the overwrite version of copy can be used - catch exceptions in BackupWallet (e.g. filesystem_error thrown when trying to overwrite without the overwrite flag set) - include db.h in walletmodel.cpp for BackupWallet function - updated doc/assets-attribution.txt and contrib/debian/copyright with copyright info for new icon