aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
AgeCommit message (Collapse)Author
2016-11-29init: Get rid of fServer flagWladimir J. van der Laan
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.
2016-10-01Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgsJorge Timón
2016-09-02Do not shadow global variablePavel Janík
2016-06-27util: Remove zero-argument versions of LogPrint and errorWladimir J. van der Laan
Changes in tinyformat, recently imported from upstream have made the zero-argument versions of formatting functions unnecessary. Remove them. This is a slight semantic change: `%` characters in the zero-argument call are now regarded and need to be escaped. As for as I know, the only use of this is in `main.cpp`.
2016-06-01Use std::atomic for fRequestShutdown and fReopenDebugLogPieter Wuille
2016-06-01Revert "Include signal.h for sig_atomic_t in WIN32"Pieter Wuille
This reverts commit 88f14b999cb70f6c556633f2889e698a05305158.
2016-05-27Include signal.h for sig_atomic_t in WIN32Pieter Wuille
2016-05-12Merge #8004: signal handling: fReopenDebugLog and fRequestShutdown should be ↵Wladimir J. van der Laan
type sig_atomic_t 3262316 fReopenDebugLog and fRequestShutdown should be type sig_atomic_t (Chirag Davé)
2016-05-09fReopenDebugLog and fRequestShutdown should be type sig_atomic_tChirag Davé
This allows access as an atomic variable in the presence of async interrupts. See issue #7433 for more details fixes: #7433
2016-05-05don't run ThreadMessageHandler at lowered priorityKaz Wesley
There's no clear reason ThreadMessageHandler should be low priority. Fixes #8010 (priority inversion).
2016-05-04util: switch LogPrint and error to variadic templatesWladimir J. van der Laan
2016-03-11Move GetTempPath() to testutil.Mustafa
2016-02-03Merge branch 'master' into single_prodnameLuke Dashjr
2016-02-03When/if the copyright line does not mention Bitcoin Core developers, add a ↵Luke Dashjr
second line to copyrights in -version, About dialog, and splash screen
2015-12-22Set copyright holders displayed in notices separately from the package nameLuke Dashjr
This helps avoid accidental removal of upstream copyright names
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-11-28[qt] Move GUI related HelpMessage() part downstreamMarcoFalke
2015-11-28[trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke
* DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
2015-11-28Constrain constant values to a single location in codeLuke Dashjr
2015-10-26Add option for microsecond precision in debug.logSuhas Daftuar
2015-09-03Move windows socket init to utility functionWladimir J. van der Laan
2015-07-06Buffer log messages and explicitly open logsAdam Weiss
Prevents stomping on debug logs in datadirs that are locked by other instances and lost parameter interaction messages that can get wiped by ShrinkDebugFile(). The log is now opened explicitly and all emitted messages are buffered until this open occurs. The version message and log cut have also been moved to the earliest possible sensible location.
2015-07-01Use real number of cores for default -par, ignore virtual coresWladimir J. van der Laan
To determine the default for `-par`, the number of script verification threads, use [boost::thread::physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency) which counts only physical cores, not virtual cores. Virtual cores are roughly a set of cached registers to avoid context switches while threading, they cannot actually perform work, so spawning a verification thread for them could even reduce efficiency and will put undue load on the system. Should fix issue #6358, as well as some other reported system overload issues, especially on Intel processors. The function was only introduced in boost 1.56, so provide a utility function `GetNumCores` to fall back for older Boost versions.
2015-06-04use const references where appropriatePhilip Kaufmann
2015-05-14Use CScheduler for net's DumpAddressesGavin Andresen
Instead of starting Yet Another Thread to dump addresses, use CScheduler to do it.
2015-04-16Separate CTranslationInterface from CClientUIInterfaceJorge Timón
2015-03-10Help messages correctly formatted (79 chars)Luca Venturini
Help messages are formatted programmatically with FormatParagraph in order not to break existing strings in Transifex. The new format works even if the translation of the strings modifies the lenght of the message. Sqashed 6 commits in a single one. Help messages correctly formatted for SVGA text mode (132 chars) Help messages are formatted programmatically with FormatParagraph in order not to break existing strings in Transifex. The new format should work even if the translation of the strings modifies the lenght of the message. Fix - syntax error Correct formatting for 79 chars Correctly based on C++ functions Removed spare spaces from option strings Fix - syntax error
2015-03-03Reinitialize state in between individual unit tests.Pieter Wuille
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.
2014-12-19Added "Core" to copyright headerssandakersmann
Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-17make all catch() arguments constPhilip Kaufmann
- I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase
2014-11-17Update comments in util to be doxygen compatibleMichael Ford
2014-10-02amount.h: update license, add header end comment + rem from util.hPhilip Kaufmann
2014-09-26Use a typedef for monetary valuesMark Friedenbach
2014-09-20Also create pid file in non-daemon modeWladimir J. van der Laan
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
2014-09-14header include cleanupPhilip Kaufmann
- ensures alphabetical ordering for includes etc. in source file headers
2014-08-28add missing header end commentsPhilip Kaufmann
- 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
2014-08-26Split up util.cpp/hWladimir J. van der Laan
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.
2014-08-26Move `COIN` and `CENT` to core.hWladimir J. van der Laan
Eventually these should end up in `money.h` after monetary amounts are typedef'ed, but at least they don't belong in `util.h`.
2014-08-26Move `*Version()` functions to version.h/cppWladimir J. van der Laan
2014-08-26Move `S_I*` constants and `MSG_NOSIGNAL` to compat.hWladimir J. van der Laan
2014-08-26Move SetThreadPriority implementation to util.cpp instead of the headerWladimir J. van der Laan
Put the THREAD_* and PRIO_ constants in compat.h.
2014-08-26Remove unused function `ByteReverse` from util.hWladimir J. van der Laan
2014-08-26Remove unused `alignup` function from util.hWladimir J. van der Laan
2014-08-26Move CMedianFilter to timedata.cppWladimir J. van der Laan
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.
2014-08-20Move strprintf define to tinyformat.hWladimir J. van der Laan
This avoids a dependency on util.h if just tinyformat is needed.
2014-07-09move rand functions from util to new random.h/.cppPhilip Kaufmann
2014-07-09add GetRandBytes() as wrapper for RAND_bytes()Philip Kaufmann
- 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
2014-07-04Show nodeid instead of addresses (for anonymity) unless otherwise requested.R E Broadley
2014-06-28Move non-trivial uint256.h methods to uint256.cppPieter Wuille
2014-06-25Move network-time related functions to timedata.cpp/hWladimir J. van der Laan
The network time-offset-mangement functions from util.cpp are moved to timedata.(cpp|h). This breaks the dependency of util on netbase.