MeshCollider
2f3bd47d44
Abstract directory locking into util.cpp
7 years ago
Akira Takizawa
595a7bab23
Increment MIT Licence copyright header year on files modified in 2017
7 years ago
MeshCollider
529b866759
Test datadir in conf file exists
7 years ago
Wladimir J. van der Laan
cf5f432c69
Add `-debuglogfile` option
...
This patch adds an option to configure the name and/or directory of the
debug log.
The user can specify either a relative path, in which case the path
is relative to the data directory. They can also specify an absolute
path to put the log anywhere else in the file system.
7 years ago
Akio Nakamura
c60c49b679
Improve help text and behavior of RPC-logging
...
A) The changes in behavior are as follows:
1. Introduce logging category "none" as alias of "0" for
both RPC-logging and bitcoind "-debug" parameter.
2. Same as "0" is given to argument of "-debug",
if "none" or "0" is given to <include>, all other given logging
categories are ignored. The same is true for <exclude>.
(Before this PR, "0" was accepted but just be ignored itself.)
B) The changes in the help text are as follows:
1. Add a descrption about the evaluation order of <include> and
<exclude> to clarify how debug loggig categories to be set.
2. Delete text that describe restriction about libevent because
it's already allowed libevent logging to be updated during runtime.
3. Add a description for category "all", "1", "none" and "0".
4. Add "optional" to the help text of <include> and <exclude>.
5. Add missing new lines before "Argument:".
6. This RPC always returns all logging categories with status.
Fix the help text to match this behavior.
7 years ago
MeshCollider
8263f6a5ac
Create walletdir if datadir doesn't exist and fix tests
7 years ago
practicalswift
a720b928c8
Remove includes in .cpp files for things the corresponding .h file already included
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
cffe85f975
Skip sys::system(...) call in case of empty command
7 years ago
Marko Bencun
fcbde9091e
remove unused gArgs wrappers
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
João Barbosa
a622a17683
Fix constness of ArgsManager methods
7 years ago
Jorge Timón
506b700dcb
Util: Remove redundant calls to gArgs.IsArgSet()
...
Return empty std::vector<std::string> with ArgsManager::GetArgs if
nothing is set for that string
8 years ago
Ricardo Velhote
c07475294a
[RPC] Add an uptime command that displays the amount of time that bitcoind has been running
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
74e8738961
Bugfix: ForceSetArg should replace entr(ies) in mapMultiArgs, not append
8 years ago
John Newbery
761392db3a
[logging] log system time and mock time
8 years ago
Jorge Timón
52922456b8
Util: Put mapMultiArgs inside ArgsManager
...
- Set ArgsManager::mapMultiArgs in ArgsManager::SoftSetArg, ForceSetArg, SoftSetBoolArg
8 years ago
Jorge Timón
f2957ce6cd
Util: Create ArgsManager class...
...
- Introduce ArgsManager::GetArgs()
- Adapt util_tests.cpp to ArgsManager
8 years ago
fanquake
93dbb15954
Remove Clang workaround for Boost 1.46
8 years ago
John Newbery
7fd50c3b70
allow libevent logging to be updated during runtime
8 years ago
John Newbery
5255aca3f4
[rpc] Add logging RPC
...
Adds an RPC to get and set currently active logging categories.
8 years ago
Wladimir J. van der Laan
f110272dc9
Remove `namespace fs=fs`
...
Having these inside functions is silly and redundant now.
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
Wladimir J. van der Laan
625488ace5
util: Work around (virtual) memory exhaustion on 32-bit w/ glibc
...
glibc-specific: On 32-bit systems set the number of arenas to 1. By
default, since glibc 2.10, the C library will create up to two heap
arenas per core. This is known to cause excessive virtual address space
usage in our usage. Work around it by setting the maximum number of
arenas to 1.
8 years ago
Thomas Snider
6d5dd60c88
No need to use OpenSSL malloc/free
8 years ago
practicalswift
53a2ba351a
[util] Remove redundant call to get() on smart pointer (thread_specific_ptr)
8 years ago
Karl-Johan Alm
a57845c20e
Refactor: Remove using namespace <xxx> from util*
8 years ago
kirit93
40f11f8872
Fix for issue #9775 . Added check for open() returning a NULL pointer.
8 years ago
Alex Morcos
29fb311858
Increase minimum debug.log size to 10MB after shrink.
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
Matt Corallo
c2f61bebb1
Add a ForceSetArg method for testing
8 years ago
Matt Corallo
4e048142a5
Lock mapArgs/mapMultiArgs access in util
8 years ago
Matt Corallo
4cd373aea8
Un-expose mapArgs from utils.h
8 years ago
Matt Corallo
0cf86a6678
Introduce (and use) an IsArgSet accessor method
8 years ago
Matt Corallo
2b5f085ad1
Fix non-const mapMultiArgs[] access after init.
...
Swap mapMultiArgs for a const-reference to a _mapMultiArgs which is
only accessed in util.cpp
8 years ago
Matt Corallo
c8042a48f0
Remove arguments to ParseConfigFile
8 years ago
Karl-Johan Alm
8c1dbc5e9d
Refactor: Removed begin/end_ptr functions.
8 years ago
Gregory Maxwell
749be013f5
Move GetWarnings() into its own file.
8 years ago
Gregory Maxwell
e3ba0ef956
Eliminate data races for strMiscWarning and fLargeWork*Found.
...
This moves all access to these datastructures through accessor functions
and protects them with a lock.
8 years ago
Gregory Maxwell
c63198f1c7
Make QT runawayException call GetWarnings instead of directly access strMiscWarning.
...
This is a first step in avoiding racy accesses to strMiscWarning.
The change required moving GetWarnings and related globals to util.
8 years ago
Wladimir J. van der Laan
deec83fd2c
init: Get rid of fServer flag
...
There is no need to store this flag globally, the variable is only used
inside the initialization process.
Thanks to Alex Morcos for the idea.
8 years ago
Matt Corallo
8b22efb6f7
Make fStartedNewLine an std::atomic_bool
...
While this doesnt really fix the race of adding timestamps
mid-logical-line, it avoids the undefined behavior of using a
bool in multiple threads.
8 years ago
Jorge Timón
3450c18a12
Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs
8 years ago
mruddy
ff2ed7a5bc
trivial: remove unnecessary variable fDaemon
8 years ago
Pavel Janík
7c069a7093
Do not shadow global variable
8 years ago