Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Always make a pid file, not only when `-daemon` specified.
This is useful for troubleshooting, for attaching debuggers and loggers
and such.
- Write the pid file only after the datadir lock was acquired
- Don't create or remove a pid file on WIN32, and also don't show the option
|
|
- ensures alphabetical ordering for includes etc. in source file headers
|
|
- ensures a consistent usage in header files
- also add a blank line after the copyright header where missing
- also remove orphan new-lines at the end of some files
|
|
Split up util.cpp/h into:
- string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach)
- money utilities (parsesmoney, formatmoney)
- time utilities (gettime*, sleep, format date):
- and the rest (logging, argument parsing, config file parsing)
The latter is basically the environment and OS handling,
and is stripped of all utility functions, so we may want to
rename it to something else than util.cpp/h for clarity (Matt suggested
osinterface).
Breaks dependency of sha256.cpp on all the things pulled in by util.
|
|
Eventually these should end up in `money.h` after monetary
amounts are typedef'ed, but at least they don't belong in `util.h`.
|
|
|
|
|
|
Put the THREAD_* and PRIO_ constants in compat.h.
|
|
|
|
|
|
Now that we no longer use the median filter to keep track of
the number of blocks of peers, that's the only place it is used.
|
|
This avoids a dependency on util.h if just tinyformat is needed.
|
|
|
|
- add a small wrapper in util around RAND_bytes() and replace with
GetRandBytes() in the code to log errors from calling RAND_bytes()
- remove OpenSSL header rand.h where no longer needed
|
|
|
|
|
|
The network time-offset-mangement functions from util.cpp are moved to
timedata.(cpp|h). This breaks the dependency of util on netbase.
|
|
bitcoin-config.h moved, but the old file is likely to still exist when
reconfiguring or switching branches. This would've caused files to not rebuild
correctly, and other strange problems.
Make the path explicit so that the old one cannot be found.
Core libs use config/bitcoin-config.h.
Libs (like crypto) which don't want access to bitcoin's headers continue
to use -Iconfig and #include bitcoin-config.h.
|
|
This is to be used for the `-version` and `-help` messages.
|
|
You can just use HexStr(script) or script.ToString() for debugging, no
need for these extra functions.
|
|
- better code readability and it belongs to net
- this is a prerequisite for a pull to add -listen to the GUI
|
|
f40dbee remove CPubKey::VerifyCompact( ) which is never used (Kamil Domanski)
28b6c1d remove GetMedianTime( ) which is never used (Kamil Domanski)
5bd4adc remove LookupHostNumeric( ) which is never used (Kamil Domanski)
595f691 remove LogException( ) which is never used (Kamil Domanski)
f4057cb remove CTransaction::IsNewerThan which is never used (Kamil Domanski)
0e31e56 remove CWallet::AddReserveKey which is never used (Kamil Domanski)
|
|
Make DateTimeStrFormat use boost::posix_time.
Also re-enable the util_DateTimeStrFormat tests, as they are no
longer platform specific.
|
|
|
|
5248ff4 SetupEnvironment() - clean commit (Stuart Cardall)
|
|
|
|
|
|
783b182 Remove dummy PRIszX macros for formatting (Wladimir J. van der Laan)
|
|
No longer necessary after implementing netmask-based matching.
Also remove a longer-unused function `skipspaces`.
|
|
None of the current integer parsing functions in util
check whether the result is valid and fits in the range
of the type. This is required for less sloppy error reporting.
|
|
Size specifiers are no longer needed now that we use typesafe tinyformat
for string formatting, instead of the system's sprintf.
No functional changes.
This continues the work in #3735.
|
|
Ignores any exceptions thrown if directory exists, otherwise re-throws exception.
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
|
|
|
|
4423571 Replace PrintException with PrintExceptionContinue + throw (Wladimir J. van der Laan)
|
|
Just a pet peeve.
(PrintException has exactly the same body as PrintExceptionContinue but
does a re-throw at the end. Move these re-throws to the call
site, this aids understanding what is going on as well as eliminates a
bit of code duplication in util.cpp)
|
|
This was a bad idea. This can't be solved with macros as any
other library that includes inttypes.h will get in the way.
The parent commit has removed all usages from the source, this commit
removes the definition.
|
|
Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h
indirectly, so we cannot fix this with just macros.
Trivial commit: apply the following script to all .cpp and .h files:
# Middle
sed -i 's/"PRIx64"/x/g' "$1"
sed -i 's/"PRIu64"/u/g' "$1"
sed -i 's/"PRId64"/d/g' "$1"
# Initial
sed -i 's/PRIx64"/"x/g' "$1"
sed -i 's/PRIu64"/"u/g' "$1"
sed -i 's/PRId64"/"d/g' "$1"
# Trailing
sed -i 's/"PRIx64/x"/g' "$1"
sed -i 's/"PRIu64/u"/g' "$1"
sed -i 's/"PRId64/d"/g' "$1"
After this commit, `git grep` for PRI.64 should turn up nothing except
the defines in util.h.
|
|
As the tinyformat-based formatting system (introduced in b77dfdc) is
type-safe, no special format characters are needed to specify sizes.
Tinyformat can support (ignore) the C99 prefixes such as "ll" but
chokes on MSVC's inttypes.h defines prefixes such as "I64X". So don't
include inttypes.h and define our own for compatibility.
(an alternative would be to sweep the entire codebase using sed -i to
get rid of the size specifiers but this has less diff impact)
|
|
in 2014.
contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
|
|
As reported by @Subo1978, error messages don't have a trailing newline
anymore after commit b77dfdc9. Add back this newline.
|
|
Switch to tinyformat-based formatting.
Tinyformat is a typesafe drop-in replacement for C99 printf functions:
https://github.com/c42f/tinyformat
|
|
Allow running bitcoind without server.
- Default to -server mode (of course) for bitcoind with SoftSetBoolArg
- Remove fForceServer argument from AppInit2
- Move fDaemon to a static variable in bitcoind
|
|
`-logtodebugger` is a strange, obscure, WIN32-only (mostly MSVC) thing.
Let's clean up the options a bit get rid of it.
test_bitcoin was using fLogToDebugger as a way to prevent logging to
debug.log. For this, add a boolean (not exposed as option) fLogToDebugLog that
defaults to true and is disabled in the tests.
|
|
Otherwise, format specifiers such as %llu will not work on XP or
earlier.
This bug was introduced with 51ed9ec9.
http://sourceforge.net/apps/trac/mingw-w64/wiki/gnu%20printf
|
|
|
|
|
|
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
|