Ben Woosley
951a44e9cd
Drop unused setRange arg to BerkeleyBatch::ReadAtCursor
6 years ago
Andrew Chow
5d296ac810
Add function to close all Db's and reload the databae environment
...
Adds a ReloadDbEnv function to BerkeleyEnvironment in order to close all Db
instances, closes the environment, resets it, and then reopens
the BerkeleyEnvironment.
Also adds a ReloadDbEnv function to BerkeleyDatabase that calls
BerkeleyEnvironment's ReloadDbEnv.
6 years ago
DrahtBot
eb7daf4d60
Update copyright headers to 2018
6 years ago
Russell Yanofsky
ea23945dbc
scripted-diff: Rename wallet database classes
...
-BEGIN VERIFY SCRIPT-
sed -i 's/\<CWalletDBWrapper\>/BerkeleyDatabase/g' src/wallet/db.h src/wallet/db.cpp
sed -i '/statuses/i/** Backend-agnostic database type. */\nusing WalletDatabase = BerkeleyDatabase\;\n' src/wallet/walletdb.h
ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' ':(exclude)*dbwrapper*' test | xargs sed -i "s:\<$1\>:$2:g"; }
ren CDBEnv BerkeleyEnvironment
ren CDB BerkeleyBatch
ren CWalletDBWrapper WalletDatabase
ren CWalletDB WalletBatch
ren dbw database
ren m_dbw m_database
ren walletdb batch
ren pwalletdb batch
ren pwalletdbIn batch_in
ren wallet/batch.h wallet/walletdb.h
ren pwalletdbEncryption encrypted_batch
-END VERIFY SCRIPT-
7 years ago
Wladimir J. van der Laan
bd59c4395c
Merge #12859 : Bugfix: Include <memory> for std::unique_ptr
...
a5bca13
Bugfix: Include <memory> for std::unique_ptr (Luke Dashjr)
Pull request description:
Not sure why all these includes were missing, but it's breaking builds for some users:
https://bugs.gentoo.org/show_bug.cgi?id=652142
(Added to all files with a reference to `std::unique_ptr`)
Tree-SHA512: 8a2c67513ca07b9bb52c34e8a20b15e56f8af2530310d9ee9b0a69694dd05e02e7a3683f14101a2685d457672b56addec591a0bb83900a0eb8e2a43d43200509
7 years ago
Luke Dashjr
a5bca13095
Bugfix: Include <memory> for std::unique_ptr
7 years ago
practicalswift
1f45e2164a
scripted-diff: Convert 11 enums into scoped enums (C++11)
...
-BEGIN VERIFY SCRIPT-
sed -i 's/enum DBErrors/enum class DBErrors/g' src/wallet/walletdb.h
git grep -l DB_ | xargs sed -i 's/DB_\(LOAD_OK\|CORRUPT\|NONCRITICAL_ERROR\|TOO_NEW\|LOAD_FAIL\|NEED_REWRITE\)/DBErrors::\1/g'
sed -i 's/^ DBErrors::/ /g' src/wallet/walletdb.h
sed -i 's/enum VerifyResult/enum class VerifyResult/g' src/wallet/db.h
sed -i 's/\(VERIFY_OK\|RECOVER_OK\|RECOVER_FAIL\)/VerifyResult::\1/g' src/wallet/db.cpp
sed -i 's/enum ThresholdState/enum class ThresholdState/g' src/versionbits.h
git grep -l THRESHOLD_ | xargs sed -i 's/THRESHOLD_\(DEFINED\|STARTED\|LOCKED_IN\|ACTIVE\|FAILED\)/ThresholdState::\1/g'
sed -i 's/^ ThresholdState::/ /g' src/versionbits.h
sed -i 's/enum SigVersion/enum class SigVersion/g' src/script/interpreter.h
git grep -l SIGVERSION_ | xargs sed -i 's/SIGVERSION_\(BASE\|WITNESS_V0\)/SigVersion::\1/g'
sed -i 's/^ SigVersion::/ /g' src/script/interpreter.h
sed -i 's/enum RetFormat {/enum class RetFormat {/g' src/rest.cpp
sed -i 's/RF_\(UNDEF\|BINARY\|HEX\|JSON\)/RetFormat::\1/g' src/rest.cpp
sed -i 's/^ RetFormat::/ /g' src/rest.cpp
sed -i 's/enum HelpMessageMode {/enum class HelpMessageMode {/g' src/init.h
git grep -l HMM_ | xargs sed -i 's/HMM_BITCOIN/HelpMessageMode::BITCOIN/g'
sed -i 's/^ HelpMessageMode::/ /g' src/init.h
sed -i 's/enum FeeEstimateHorizon/enum class FeeEstimateHorizon/g' src/policy/fees.h
sed -i 's/enum RBFTransactionState/enum class RBFTransactionState/g' src/policy/rbf.h
git grep -l RBF_ | xargs sed -i 's/RBF_TRANSACTIONSTATE_\(UNKNOWN\|REPLACEABLE_BIP125\|FINAL\)/RBFTransactionState::\1/g'
sed -i 's/^ RBFTransactionState::/ /g' src/policy/rbf.h
sed -i 's/enum BlockSource {/enum class BlockSource {/g' src/qt/clientmodel.h
git grep -l BLOCK_SOURCE_ | xargs sed -i 's/BLOCK_SOURCE_\(NONE\|REINDEX\|DISK\|NETWORK\)/BlockSource::\1/g'
sed -i 's/^ BlockSource::/ /g' src/qt/clientmodel.h
sed -i 's/enum FlushStateMode {/enum class FlushStateMode {/g' src/validation.cpp
sed -i 's/FLUSH_STATE_\(NONE\|IF_NEEDED\|PERIODIC\|ALWAYS\)/FlushStateMode::\1/g' src/validation.cpp
sed -i 's/^ FlushStateMode::/ /g' src/validation.cpp
sed -i 's/enum WitnessMode {/enum class WitnessMode {/g' src/test/script_tests.cpp
sed -i 's/WITNESS_\(NONE\|PKH\|SH\)/WitnessMode::\1/g' src/test/script_tests.cpp
sed -i 's/^ WitnessMode::/ /g' src/test/script_tests.cpp
-END VERIFY SCRIPT-
7 years ago
Russell Yanofsky
d8a99f65e5
Allow wallet files in multiple directories
...
Remove requirement that two wallet files can only be opened at the same time if
they are contained in the same directory.
This change mostly consists of updates to function signatures (updating
functions to take fs::path arguments, instead of combinations of strings,
fs::path, and CDBEnv / CWalletDBWrapper arguments).
7 years ago
MeshCollider
e60cb99c58
Add a lock to the wallet directory
7 years ago
Akira Takizawa
595a7bab23
Increment MIT Licence copyright header year on files modified in 2017
7 years ago
MeshCollider
0530ba0eae
Add -walletdir parameter to specify custom wallet dir
7 years ago
MeshCollider
1a445343f6
scripted-diff: Replace #include "" with #include <> (ryanofsky)
...
-BEGIN VERIFY SCRIPT-
for f in \
src/*.cpp \
src/*.h \
src/bench/*.cpp \
src/bench/*.h \
src/compat/*.cpp \
src/compat/*.h \
src/consensus/*.cpp \
src/consensus/*.h \
src/crypto/*.cpp \
src/crypto/*.h \
src/crypto/ctaes/*.h \
src/policy/*.cpp \
src/policy/*.h \
src/primitives/*.cpp \
src/primitives/*.h \
src/qt/*.cpp \
src/qt/*.h \
src/qt/test/*.cpp \
src/qt/test/*.h \
src/rpc/*.cpp \
src/rpc/*.h \
src/script/*.cpp \
src/script/*.h \
src/support/*.cpp \
src/support/*.h \
src/support/allocators/*.h \
src/test/*.cpp \
src/test/*.h \
src/wallet/*.cpp \
src/wallet/*.h \
src/wallet/test/*.cpp \
src/wallet/test/*.h \
src/zmq/*.cpp \
src/zmq/*.h
do
base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-
7 years ago
practicalswift
29ab96dbd2
Use unique_ptr for dbenv (DbEnv)
7 years ago
Dan Raviv
2a07f878a8
Refactor: Modernize disallowed copy constructors/assignment
...
Use C++11's better capability of expressing an interface of a non-copyable class by publicly deleting its copy ctor and assignment operator instead of just declaring them private.
7 years ago
MarcoFalke
b6a48914c5
Merge #9964 : Add const to methods that do not modify the object for which it is called
...
6e8c48dc5
Add const to methods that do not modify the object for which it is called (practicalswift)
Pull request description:
Tree-SHA512: a6888111ba16fb796e320e60806e1a77d36f545989b5405dc7319992291800109eab0b8e8c286b784778f41f1ff5289e7cb6b4afd7aec77f385fbcafc02cffc1
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
6e8c48dc59
Add const to methods that do not modify the object for which it is called
7 years ago
João Barbosa
4652791141
Fix uninitialized atomic variables
7 years ago
Alex Morcos
8e69adc665
Add missing include for atomic in db.h
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
Thomas Snider
6c914ac176
[wallet] Securely erase potentially sensitive keys/values
8 years ago
practicalswift
b51aaf1c42
Remove unused C++ code not covered by unit tests
8 years ago
Wladimir J. van der Laan
69d2e9ba67
wallet: Make IsDummy private in CWalletDBWrapper
...
This is only for use in the low-level functions, and CDB is already
a friend class.
8 years ago
Wladimir J. van der Laan
33232810dc
wallet: CWalletDB CDB composition not inheritance
...
CWalletDB now contains a CDB instead of inheriting from it.
This makes it easier to replace the internal transaction with a different
database, without leaking through internals.
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
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
Jonas Schnelli
7184e25c80
[Wallet] refactor CWallet/CWalletDB/CDB
...
Try to hide CDB/bitdb behinde CWalletDB.
Prepare for full wallet database abstraction.
8 years ago
Wladimir J. van der Laan
02464da5e4
Merge #9227 : Make nWalletDBUpdated atomic to avoid a potential race.
...
d63ff62
Make nWalletDBUpdated atomic to avoid a potential race. (Patrick Strateman)
8 years ago
Pieter Wuille
07fd147b9f
Merge #9353 : Add data() method to CDataStream (and use it)
...
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)
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
Jonas Schnelli
beef966e36
[Wallet] remove unused code/conditions in ReadAtCursor
8 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
3703385547
remove unused classes from db.h
10 years ago
Philip Kaufmann
a21df62069
ensure consistent header comment naming conventions
...
- BITCOIN_FOLDER_SUBFOLDER_FILENAME_H
10 years ago
Philip Kaufmann
f702d1c66d
move ThreadFlushWalletDB declaration to walletdb.h
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