Marko Bencun
bb81e17355
scripted-diff: stop using the gArgs wrappers
...
They were temporary additions to ease the transition.
-BEGIN VERIFY SCRIPT-
find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g'
-END VERIFY SCRIPT-
7 years ago
Karl-Johan Alm
03bc719a85
[wallet] Close DB on error.
7 years ago
practicalswift
90d4d89230
scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL
...
-BEGIN VERIFY SCRIPT-
sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h
sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp
sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp
sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp
sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp
sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp
-END VERIFY SCRIPT-
7 years ago
practicalswift
41bf1598f1
Remove unreachable code
8 years ago
Jorge Timón
5995735c5b
scripted-diff: Remove #include <boost/foreach.hpp>
...
-BEGIN VERIFY SCRIPT-
sed -i ':a;N;$!ba;s/#include <boost\/foreach.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp
-END VERIFY SCRIPT-
8 years ago
Marko Bencun
1d1ea9f096
Turn TryCreateDirectory() into TryCreateDirectories()
...
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.
8 years ago
practicalswift
49de096c2a
Remove unused Boost includes
8 years ago
Luke Dashjr
a2a5f3f0f0
wallet: Base backup filenames on original wallet filename
8 years ago
Luke Dashjr
b823a4c9f6
wallet: Include actual backup filename in recovery warning message
8 years ago
Luke Dashjr
b124cf04ea
Wallet: Replace pwalletMain with a vector of wallet pointers
8 years ago
Luke Dashjr
19b3648bb5
CWalletDB: Store the update counter per wallet
8 years ago
Jorge Timón
7c00c26726
scripted-diff: Fully remove BOOST_FOREACH
...
-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-
8 years ago
practicalswift
90593ed92c
Limit variable scope
8 years ago
practicalswift
a8c09affce
Remove unused variables
8 years ago
practicalswift
b51aaf1c42
Remove unused C++ code not covered by unit tests
8 years ago
Wladimir J. van der Laan
be9e1a968d
wallet: Reduce references to global bitdb environment
8 years ago
Wladimir J. van der Laan
071c95570b
wallet: Get rid of fFileBacked
...
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.
8 years ago
Wladimir J. van der Laan
71afe3c099
wallet: Introduce database handle wrapper
...
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.
8 years ago
Wladimir J. van der Laan
2a5f574762
Use fsbridge for fopen and freopen
...
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.
8 years ago
Wladimir J. van der Laan
bac5c9cf64
Replace uses of boost::filesystem with fs
...
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'
```
8 years ago
Wladimir J. van der Laan
7d5172d354
Replace includes of boost/filesystem.h with fs.h
...
This is step one in abstracting the use of boost::filesystem.
8 years ago
Gregory Maxwell
6b3bb3d9ba
Change LogAcceptCategory to use uint32_t rather than sets of strings.
...
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.
8 years ago
Pavel Janík
d7f80b6dcb
Rename first iterator to prevent shadowing.
8 years ago
Karl-Johan Alm
8a5228197c
Refactor: Remove using namespace <xxx> from wallet/
8 years ago
Jonas Schnelli
7184e25c80
[Wallet] refactor CWallet/CWalletDB/CDB
...
Try to hide CDB/bitdb behinde CWalletDB.
Prepare for full wallet database abstraction.
8 years ago
isle2983
27765b6403
Increment MIT Licence copyright header year on files modified in 2016
...
Edited via:
$ contrib/devtools/copyright_header.py update .
8 years ago
Patrick Strateman
d63ff6265b
Make nWalletDBUpdated atomic to avoid a potential race.
8 years ago
Wladimir J. van der Laan
5113474a91
wallet: Use CDataStream.data()
8 years ago
Pavel Janík
b175cb755b
Do not shadow variables.
8 years ago
Alexey Vesnin
323a5fe06a
Berkeley DB v6 compatibility fix
...
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
8 years ago
Jonas Schnelli
beef966e36
[Wallet] remove unused code/conditions in ReadAtCursor
8 years ago
crowning-
fab2e26d20
CDB: fix debug output
...
It doesn't really help to clear a variable before printing it to the debug log.
8 years ago
Wladimir J. van der Laan
f31b6b8995
test: test leading space for ParseHex
...
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).
9 years ago
Wladimir J. van der Laan
ca8fb59ae1
wallet: Warn on unexpected EOF while salvaging wallet
...
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 .
9 years ago
MarcoFalke
fa6d4cc095
[walletdb] Fix syntax error in key parser
9 years ago
MarcoFalke
fa24439ff3
Bump copyright headers to 2015
9 years ago
Luke Dashjr
b966aa836a
Constrain constant values to a single location in code
9 years ago
Luke Dashjr
420a82f1ae
Bugfix: Describe dblogsize option correctly (it refers to the wallet database, not memory pool)
9 years ago
Philip Kaufmann
0ce30eaa36
fix crash on shutdown when e.g. changing -txindex and abort action
...
- 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
10 years ago
Philip Kaufmann
341e2385d5
use constant references for strings in functions in wallet/*.*
10 years ago
Jonas Schnelli
50c72f23ad
[Move Only] Move wallet related things to src/wallet/
...
could once be renamed from /src/wallet to /src/legacywallet.
10 years ago
Pieter Wuille
51598b2631
Reinitialize state in between individual unit tests.
...
This changes the TestingSetup fixture to be per-unit-test rather than global.
Most tests don't need it, so it's only invoked in a few.
10 years ago
Cory Fields
1630219d90
openssl: abstract out OPENSSL_cleanse
...
This makes it easier for us to replace it if desired, since it's now only in
one spot. Also, it avoids the openssl include from allocators.h, which
essentially forced openssl to be included from every compilation unit.
10 years ago
Pavel Janík
5262fde0ec
Remove whitespaces before double colon in errors and logs
10 years ago
Cory Fields
a3241998e1
namespace: remove boost namespace pollution
10 years ago
sandakersmann
f914f1a746
Added "Core" to copyright headers
...
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
10 years ago
Michael Ford
78253fcbad
Remove references to X11 licence
10 years ago
Cozz Lovan
44bc988e7b
[Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..)
10 years ago
Pieter Wuille
20e01b1a03
Apply clang-format on some infrequently-updated files
10 years ago
Philip Kaufmann
22d7e7014f
prefer const string& over char* in CDB and CWalletDB constructor
...
- also make parameter of CDBEnv::CheckpointLSN a constant reference
10 years ago