aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.cpp
AgeCommit message (Collapse)Author
2017-06-14Turn TryCreateDirectory() into TryCreateDirectories()Marko Bencun
Use case: TryCreateDirectory(GetDataDir() / "blocks" / "index") would fail if the blocks directory was not explicitly created before. The line that did so was in a weird location and could be removed as a result.
2017-06-12Merge #8694: Basic multiwallet supportWladimir J. van der Laan
c237bd7 wallet: Update formatting (Luke Dashjr) 9cbe8c8 wallet: Forbid -salvagewallet, -zapwallettxes, and -upgradewallet with multiple wallets (Luke Dashjr) a2a5f3f wallet: Base backup filenames on original wallet filename (Luke Dashjr) b823a4c wallet: Include actual backup filename in recovery warning message (Luke Dashjr) 84dcb45 Bugfix: wallet: Fix warningStr, errorStr argument order (Luke Dashjr) 008c360 Wallet: Move multiwallet sanity checks to CWallet::Verify, and do other checks on all wallets (Luke Dashjr) 0f08575 Wallet: Support loading multiple wallets if -wallet used more than once (Luke Dashjr) b124cf0 Wallet: Replace pwalletMain with a vector of wallet pointers (Luke Dashjr) 19b3648 CWalletDB: Store the update counter per wallet (Luke Dashjr) 74e8738 Bugfix: ForceSetArg should replace entr(ies) in mapMultiArgs, not append (Luke Dashjr) 23fb9ad wallet: Move nAccountingEntryNumber from static/global to CWallet (Luke Dashjr) 9d15d55 Bugfix: wallet: Increment "update counter" when modifying account stuff (Luke Dashjr) f28eb80 Bugfix: wallet: Increment "update counter" only after actually making the applicable db changes to avoid potential races (Luke Dashjr) Tree-SHA512: 23f5dda58477307bc07997010740f1dc729164cdddefd2f9a2c9c7a877111eb1516d3e2ad4f9b104621f0b7f17369c69fcef13d28b85cb6c01d35f09a8845f23
2017-06-11Merge #10546: Remove 33 unused Boost includesWladimir J. van der Laan
49de096 Remove unused Boost includes (practicalswift) Tree-SHA512: ff2dad94f9eeb1dc50fcffd0e94e1686be04e4e5bc45f58ae955d630c15cd25bb8f5583d0aa1f2f263b5a723be79747ef3c6e6b417c7be7787c0abc8d1874019
2017-06-09Merge #10521: Limit variable scopePieter Wuille
90593ed92 Limit variable scope (practicalswift) Tree-SHA512: 4719e303688a31aefbe1d239e86b21dd3c2045524e08bd628c6ba0c6c2a97de14d04305b9beafe0b1dcde7229793e6663168953f192e88ed409be5c30fd2a9a9
2017-06-09Remove unused Boost includespracticalswift
2017-06-06wallet: Base backup filenames on original wallet filenameLuke Dashjr
2017-06-06wallet: Include actual backup filename in recovery warning messageLuke Dashjr
2017-06-06Wallet: Replace pwalletMain with a vector of wallet pointersLuke Dashjr
2017-06-05CWalletDB: Store the update counter per walletLuke Dashjr
2017-06-05scripted-diff: Fully remove BOOST_FOREACHJorge Timón
-BEGIN VERIFY SCRIPT- sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; -END VERIFY SCRIPT-
2017-06-05Limit variable scopepracticalswift
2017-06-03Remove unused variablespracticalswift
2017-04-26Remove unused C++ code not covered by unit testspracticalswift
2017-04-20wallet: Reduce references to global bitdb environmentWladimir J. van der Laan
2017-04-20wallet: Get rid of fFileBackedWladimir J. van der Laan
Instead, CWalletDB() with a dummy handle will just give you a no-op database in which writes always succeeds and reads always fail. CDB already had functionality for this, so just use that.
2017-04-20wallet: Introduce database handle wrapperWladimir J. van der Laan
Abstract database handle from explicit strFilename into CWalletDBWrapper. Also move CWallet::Backup to db.cpp - as it deals with representation details this is a database specific operation.
2017-04-03Use fsbridge for fopen and freopenWladimir J. van der Laan
Abstracts away how a path is opened to a `FILE*`. Reduces the number of places where path is converted to a string for anything else but printing.
2017-04-03Replace uses of boost::filesystem with fsWladimir J. van der Laan
Step two in abstracting away boost::filesystem. To repeat this, simply run: ``` git ls-files \*.cpp \*.h | xargs sed -i 's/boost::filesystem/fs/g' ```
2017-04-03Replace includes of boost/filesystem.h with fs.hWladimir J. van der Laan
This is step one in abstracting the use of boost::filesystem.
2017-04-01Change LogAcceptCategory to use uint32_t rather than sets of strings.Gregory Maxwell
This changes the logging categories to boolean flags instead of strings. This simplifies the acceptance testing by avoiding accessing a scoped static thread local pointer to a thread local set of strings. It eliminates the only use of boost::thread_specific_ptr outside of lockorder debugging. This change allows log entries to be directed to multiple categories and makes it easy to change the logging flags at runtime (e.g. via an RPC, though that isn't done by this commit.) It also eliminates the fDebug global. Configuration of unknown logging categories now produces a warning.
2017-03-18Rename first iterator to prevent shadowing.Pavel Janík
2017-03-08Refactor: Remove using namespace <xxx> from wallet/Karl-Johan Alm
2017-03-06[Wallet] refactor CWallet/CWalletDB/CDBJonas Schnelli
Try to hide CDB/bitdb behinde CWalletDB. Prepare for full wallet database abstraction.
2017-02-06Merge #9227: Make nWalletDBUpdated atomic to avoid a potential race.Wladimir J. van der Laan
d63ff62 Make nWalletDBUpdated atomic to avoid a potential race. (Patrick Strateman)
2017-01-09Merge #9353: Add data() method to CDataStream (and use it)Pieter Wuille
5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan) e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan) adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan) a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan) af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-12-21Make nWalletDBUpdated atomic to avoid a potential race.Patrick Strateman
2016-12-15wallet: Use CDataStream.data()Wladimir J. van der Laan
2016-08-31Do not shadow variables.Pavel Janík
2016-08-30Berkeley DB v6 compatibility fixAlexey Vesnin
Fixes building error looking like this: CXX wallet/libbitcoin_wallet_a-db.o wallet/db.cpp: In member function ‘void CDBEnv::EnvShutdown()’: wallet/db.cpp:46:16: error: call of overloaded ‘DbEnv(int)’ is ambiguous DbEnv(0).remove(strPath.c_str(), 0); ^ wallet/db.cpp:46:16: note: candidates are: In file included from wallet/db.h:21:0, from wallet/db.cpp:6: /usr/include/db_cxx.h:916:2: note: DbEnv::DbEnv(const DbEnv&) DbEnv(const DbEnv &); ^ /usr/include/db_cxx.h:518:2: note: DbEnv::DbEnv(DB_ENV) DbEnv(DB_ENV *dbenv); ^ /usr/include/db_cxx.h:516:2: note: DbEnv::DbEnv(u_int32_t) DbEnv(u_int32_t flags); ^ Makefile:5780: recipe for target 'wallet/libbitcoin_wallet_a-db.o' failed make[2]: ** [wallet/libbitcoin_wallet_a-db.o] Error 1
2016-08-23[Wallet] remove unused code/conditions in ReadAtCursorJonas Schnelli
2016-08-18CDB: fix debug outputcrowning-
It doesn't really help to clear a variable before printing it to the debug log.
2016-02-29Merge #7537: wallet: Warn on unexpected EOF while salvaging walletWladimir J. van der Laan
ca8fb59 wallet: Warn on unexpected EOF while salvaging wallet (Wladimir J. van der Laan)
2016-02-15test: test leading space for ParseHexWladimir J. van der Laan
BerkeleyDB dump files have key and value lines indented. The salvage code passes these to ParseHex as-is. Check this in the tests (should just pass with current code).
2016-02-15wallet: Warn on unexpected EOF while salvaging walletWladimir J. van der Laan
Check for EOF before every getline, and warn when reading gets to EOF before the end of the data. Stricter error checking could shed more light on issues such as #7463 and #7379.
2016-01-20[walletdb] Fix syntax error in key parserMarcoFalke
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-11-28Constrain constant values to a single location in codeLuke Dashjr
2015-10-01Bugfix: Describe dblogsize option correctly (it refers to the wallet ↵Luke Dashjr
database, not memory pool)
2015-06-16fix crash on shutdown when e.g. changing -txindex and abort actionPhilip Kaufmann
- fixes #3136 - the problem is related to Boost path and a static initialized internal pointer - using a std::string in CDBEnv::EnvShutdown() prevents the problem - this removes the boost::filesystem::path path field from CDBEnv
2015-03-21use constant references for strings in functions in wallet/*.*Philip Kaufmann
2015-03-12[Move Only] Move wallet related things to src/wallet/Jonas Schnelli
could once be renamed from /src/wallet to /src/legacywallet.