aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Introduce basic Dogecoin brandingRoss Nicoll2019-03-251-6/+6
|
* util: Work around (virtual) memory exhaustion on 32-bit w/ glibcWladimir J. van der Laan2017-03-311-0/+14
| | | | | | | | | | | 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. Github-Pull: #10120 Rebased-From: 625488ace5c41ccba1b68323a72588000782f820
* Fix for issue #9775. Added check for open() returning a NULL pointer.kirit932017-02-211-7/+8
| | | | | Github-Pull: #9798 Rebased-From: 40f11f8872c3e9f380f8278f984dfdabffe77539
* Increase minimum debug.log size to 10MB after shrink.Alex Morcos2017-01-241-2/+6
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Add a ForceSetArg method for testingMatt Corallo2016-12-271-0/+8
|
* Lock mapArgs/mapMultiArgs access in utilMatt Corallo2016-12-241-11/+23
|
* Un-expose mapArgs from utils.hMatt Corallo2016-12-241-1/+1
|
* Introduce (and use) an IsArgSet accessor methodMatt Corallo2016-12-231-1/+6
|
* Fix non-const mapMultiArgs[] access after init.Matt Corallo2016-12-231-7/+11
| | | | | Swap mapMultiArgs for a const-reference to a _mapMultiArgs which is only accessed in util.cpp
* Remove arguments to ParseConfigFileMatt Corallo2016-12-231-6/+4
|
* Merge #9236: Fix races for strMiscWarning and fLargeWork*Found, make QT ↵Wladimir J. van der Laan2016-12-191-1/+1
|\ | | | | | | | | | | | | | | runawayException use GetWarnings 749be01 Move GetWarnings() into its own file. (Gregory Maxwell) e3ba0ef Eliminate data races for strMiscWarning and fLargeWork*Found. (Gregory Maxwell) c63198f Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (Gregory Maxwell)
| * Move GetWarnings() into its own file.Gregory Maxwell2016-12-031-80/+0
| |
| * Eliminate data races for strMiscWarning and fLargeWork*Found.Gregory Maxwell2016-12-031-0/+33
| | | | | | | | | | This moves all access to these datastructures through accessor functions and protects them with a lock.
| * Make QT runawayException call GetWarnings instead of directly access ↵Gregory Maxwell2016-12-031-0/+47
| | | | | | | | | | | | | | | | strMiscWarning. This is a first step in avoiding racy accesses to strMiscWarning. The change required moving GetWarnings and related globals to util.
* | Refactor: Removed begin/end_ptr functions.Karl-Johan Alm2016-12-091-2/+2
|/
* Merge #9230: Fix some benign races in timestamp loggingWladimir J. van der Laan2016-12-011-2/+2
|\ | | | | | | | | 8b22efb Make fStartedNewLine an std::atomic_bool (Matt Corallo) 507145d Fix race when accessing std::locale::classic() (Matt Corallo)
| * Make fStartedNewLine an std::atomic_boolMatt Corallo2016-11-271-2/+2
| | | | | | | | | | | | 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.
* | init: Get rid of fServer flagWladimir J. van der Laan2016-11-291-1/+0
|/ | | | | | | 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.
* Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgsJorge Timón2016-10-011-4/+5
|
* Merge #8656: Trivial: Do not shadow global variable fileoutWladimir J. van der Laan2016-09-211-6/+6
|\ | | | | | | 7c069a7 Do not shadow global variable (Pavel Janík)
| * Do not shadow global variablePavel Janík2016-09-021-6/+6
| |
* | trivial: remove unnecessary variable fDaemonmruddy2016-09-041-1/+0
|/
* [util] CopyrightHolders: Check for untranslated substitutionMarcoFalke2016-07-021-5/+4
| | | | Also, remove check which is always true
* Use std::atomic for fRequestShutdown and fReopenDebugLogPieter Wuille2016-06-011-1/+1
|
* Merge #8004: signal handling: fReopenDebugLog and fRequestShutdown should be ↵Wladimir J. van der Laan2016-05-121-1/+1
|\ | | | | | | | | | | type sig_atomic_t 3262316 fReopenDebugLog and fRequestShutdown should be type sig_atomic_t (Chirag Davé)
| * fReopenDebugLog and fRequestShutdown should be type sig_atomic_tChirag Davé2016-05-091-1/+1
| | | | | | | | | | | | | | | | This allows access as an atomic variable in the presence of async interrupts. See issue #7433 for more details fixes: #7433
* | don't run ThreadMessageHandler at lowered priorityKaz Wesley2016-05-051-13/+0
|/ | | | | There's no clear reason ThreadMessageHandler should be low priority. Fixes #8010 (priority inversion).
* Removed call to `TryCreateDirectory` from `GetDefaultDataDir` in `src/util.cpp`.Alexander Regueiro2016-04-131-3/+1
| | | | | See https://github.com/bitcoin/bitcoin/issues/7845#issuecomment-207684728. Also refactored `GetDefaultDataDir` function to return path for Mac in one expression.
* Move GetTempPath() to testutil.Mustafa2016-03-111-22/+0
|
* Merge branch 'master' into single_prodnameLuke Dashjr2016-02-031-6/+8
|\
| * Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| |
| * [trivial] Reuse translation and cleanup DEFAULT_* valuesMarcoFalke2015-11-281-2/+2
| | | | | | | | | | * DEFAULT_DISABLE_SAFEMODE = false * Use DEFAULT_* constants for extern bools
| * Constrain constant values to a single location in codeLuke Dashjr2015-11-281-3/+6
| |
| * util: Don't set strMiscWarning on every exceptionWladimir J. van der Laan2015-11-271-1/+0
| | | | | | | | | | Fixes #6809 - run-of-the-mill exceptions should not get into strMiscWarning (which is reported by `getinfo`).
* | When/if the copyright line does not mention Bitcoin Core developers, add a ↵Luke Dashjr2016-02-031-5/+9
| | | | | | | | second line to copyrights in -version, About dialog, and splash screen
* | Bugfix: Actually use _COPYRIGHT_HOLDERS_SUBSTITUTION everywhereLuke Dashjr2016-01-191-1/+1
| |
* | Set copyright holders displayed in notices separately from the package nameLuke Dashjr2015-12-221-0/+7
|/ | | | This helps avoid accidental removal of upstream copyright names
* Add option for microsecond precision in debug.logSuhas Daftuar2015-10-261-3/+8
|
* Changed logging to make -logtimestamps to work also for -printtoconsoleArne Brutschy2015-09-301-3/+4
|
* Move windows socket init to utility functionWladimir J. van der Laan2015-09-031-0/+12
|
* Fix argument parsing oddity with -noXWladimir J. van der Laan2015-07-271-28/+19
| | | | | | | | `bitcoind -X -noX` ends up, unintuitively, with `X` set. (for all boolean options X) This result is due to the odd two-pass processing of arguments. This patch fixes this oddity and simplifies the code at the same time.
* Merge pull request #6287Wladimir J. van der Laan2015-07-231-1/+1
|\ | | | | | | | | | | a794284 locking: add a quick example of GUARDED_BY (Cory Fields) 2b890dd locking: fix a few small issues uncovered by -Wthread-safety (Cory Fields) cd27bba locking: teach Clang's -Wthread-safety to cope with our scoped lock macros (Cory Fields)
| * locking: fix a few small issues uncovered by -Wthread-safetyCory Fields2015-06-161-1/+1
| | | | | | | | | | | | - rpcwallet: No need to lock twice here - openssl: Clang doesn't understand selective lock/unlock here. Ignore it. - CNode: Fix a legitimate (though very unlikely) locking bug.
* | Merge pull request #6149Wladimir J. van der Laan2015-07-221-26/+77
|\ \ | | | | | | | | | 27d7605 Buffer log messages and explicitly open logs (Adam Weiss)
| * | Buffer log messages and explicitly open logsAdam Weiss2015-07-061-26/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | openssl: avoid config file load/raceCory Fields2015-07-141-0/+8
|/ /
* / Use real number of cores for default -par, ignore virtual coresWladimir J. van der Laan2015-07-011-0/+10
|/ | | | | | | | | | | | | | | | | 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.
* use const references where appropriatePhilip Kaufmann2015-06-041-1/+1
|
* Make command line option to show all debugging consistent with similar optionslpescher2015-05-191-0/+1
| | | | | | | Most people expect a value of 1 to enable all for command line arguments. However to do this for the -debug option you must type "-debug=". This has been changed to allow "-debug=1" as well as "-debug=" to enable all debug logging