aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|/
* Merge #10574: Remove includes in .cpp files for things the corresponding .h ↵Wladimir J. van der Laan2017-12-121-6/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file already included a720b92 Remove includes in .cpp files for things the corresponding .h file already included (practicalswift) Pull request description: Remove includes in .cpp files for things the corresponding .h file already included. Example case: * `addrdb.cpp` includes `addrdb.h` and `fs.h` * `addrdb.h` includes `fs.h` Then remove the direct inclusion of `fs.h` in `addrman.cpp` and rely on the indirect inclusion of `fs.h` via the included `addrdb.h`. In line with the header include guideline (see #10575). Tree-SHA512: 8704b9de3011a4c234db336a39f7d2c139e741cf0f7aef08a5d3e05197e1e18286b863fdab25ae9638af4ff86b3d52e5cab9eed66bfa2476063aa5c79f9b0346
| * Remove includes in .cpp files for things the corresponding .h file already ↵practicalswift2017-11-161-6/+0
| | | | | | | | included
* | Test datadir in conf file existsMeshCollider2017-12-061-0/+3
| |
* | Add `-debuglogfile` optionWladimir J. van der Laan2017-11-301-11/+26
| | | | | | | | | | | | | | | | | | 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.
* | Merge #11191: RPC: Improve help text and behavior of RPC-logging.Wladimir J. van der Laan2017-11-301-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c60c49b Improve help text and behavior of RPC-logging (Akio Nakamura) Pull request description: 1. It is allowed `libevent` logging to be updated during runtime, but still described that restriction in the help text. So we delete these text. 2. Add a descrption about the evaluation order of `<include>` and `<exclude>` to clarify how debug loggig categories to be set. 3. Add a description about the available logging category `"all"` which is not explained. 4. Add `"optional"` to the help text of `<include>` and `<exclude>`. 5. Add missing new lines before `"Argument:"`. 6. `"0"`,`"1"` are allowed in both array of `<include>` and `<exclude>`. `"0"` is **ignored** and `"1"` is treated **same as** `"all"`. It is confusing, so forbid them. 7. It always returns all logging categories with status. Fix the help text to match this behavior. Tree-SHA512: c2142da1a9bf714af8ebc38ac0d82394e2073fc0bd56f136372e3db7b2af3b6746f8d6b0241fe66c1698c208c124deb076be83f07dec0d0a180ad150593af415
| * | Improve help text and behavior of RPC-loggingAkio Nakamura2017-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Create walletdir if datadir doesn't exist and fix testsMeshCollider2017-11-181-1/+4
| |/ |/|
* | scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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-
* | Merge #10939: [init] Check non-emptiness of -blocknotify command prior to ↵Wladimir J. van der Laan2017-10-041-0/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | executing cffe85f Skip sys::system(...) call in case of empty command (practicalswift) 6fb8f5f Check that -blocknotify command is non-empty before executing (practicalswift) Pull request description: Check that `-blocknotify` command is non-empty before executing. To make the `BlockNotifyCallback(...)` (`-blocknotify`) behaviour consistent with that of: * `AlertNotify(...)` (`-alertnotify`) * `AddToWallet(...)` (`-walletnotify`) Tree-SHA512: 18272166793a5a8b9cc2a727bfbcea53d38c329a55bc975c02db601329d608a61c20e026ce4b616193ecd3810dca4d3e2cb3bf773898a51872008a8dba96763e
| * Skip sys::system(...) call in case of empty commandpracticalswift2017-08-141-0/+1
| |
* | Merge #10901: Fix constness of ArgsManager methodsMarcoFalke2017-08-161-17/+15
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | a622a1768 Fix constness of ArgsManager methods (João Barbosa) Pull request description: Make `cs_args` mutex mutable so that const methods can acquire it. There's also tiny performance improvement by avoiding two map lookups when retrieving an argument value. Tree-SHA512: ece58469745f2743b4b643242b51889a3d9c5b76492ed70bb74d4e5b378fff59da79fc129e499da779bf9f488c9435dda17ad1f3a804c1c30f56af422389e8bd
| * Fix constness of ArgsManager methodsJoão Barbosa2017-07-241-17/+15
| |
* | remove unused gArgs wrappersMarko Bencun2017-08-141-3/+3
| |
* | scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-071-14/+14
|/ | | | | | | | | | | | | 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-
* Merge #10118: Util: Remove redundant calls to argsGlobal.IsArgSet()Wladimir J. van der Laan2017-06-271-1/+3
|\ | | | | | | | | | | | | ed866ab Indentation after 'Remove redundant calls to gArgs.IsArgSet()' (Jorge Timón) 506b700 Util: Remove redundant calls to gArgs.IsArgSet() (Jorge Timón) Tree-SHA512: 4f97a0bf2a76c0f351a6343db62898cf057d745c848de00fa09465e870a120f28e0d836cafd6a047f4ec0da7ab671aebee43fa7410c9f0e66382edd1bb2009ba
| * Util: Remove redundant calls to gArgs.IsArgSet()Jorge Timón2017-06-271-1/+3
| | | | | | | | | | Return empty std::vector<std::string> with ArgsManager::GetArgs if nothing is set for that string
* | [RPC] Add an uptime command that displays the amount of time that bitcoind ↵Ricardo Velhote2017-06-251-0/+8
|/ | | | has been running
* Merge #9895: Turn TryCreateDirectory() into TryCreateDirectories()Wladimir J. van der Laan2017-06-141-4/+4
|\ | | | | | | | | | | 1d1ea9f Turn TryCreateDirectory() into TryCreateDirectories() (Marko Bencun) Tree-SHA512: 49a524167bcf66e351a964c88d09cb3bcee12769a32da83410e3ba649fa4bcdbf0478d41e4d09bb55adb9b3f122e742271db6feb30bbafe2a7973542b5f10f79
| * Turn TryCreateDirectory() into TryCreateDirectories()Marko Bencun2017-06-141-4/+4
| | | | | | | | | | | | | | | | 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.
* | Merge #8694: Basic multiwallet supportWladimir J. van der Laan2017-06-121-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c237bd7 wallet: Update formatting (Luke Dashjr) 9cbe8c8 wallet: Forbid -salvagewallet, -zapwallettxes, and -upgradewallet with multiple wallets (Luke Dashjr) a2a5f3f wallet: Base backup filenames on original wallet filename (Luke Dashjr) b823a4c wallet: Include actual backup filename in recovery warning message (Luke Dashjr) 84dcb45 Bugfix: wallet: Fix warningStr, errorStr argument order (Luke Dashjr) 008c360 Wallet: Move multiwallet sanity checks to CWallet::Verify, and do other checks on all wallets (Luke Dashjr) 0f08575 Wallet: Support loading multiple wallets if -wallet used more than once (Luke Dashjr) b124cf0 Wallet: Replace pwalletMain with a vector of wallet pointers (Luke Dashjr) 19b3648 CWalletDB: Store the update counter per wallet (Luke Dashjr) 74e8738 Bugfix: ForceSetArg should replace entr(ies) in mapMultiArgs, not append (Luke Dashjr) 23fb9ad wallet: Move nAccountingEntryNumber from static/global to CWallet (Luke Dashjr) 9d15d55 Bugfix: wallet: Increment "update counter" when modifying account stuff (Luke Dashjr) f28eb80 Bugfix: wallet: Increment "update counter" only after actually making the applicable db changes to avoid potential races (Luke Dashjr) Tree-SHA512: 23f5dda58477307bc07997010740f1dc729164cdddefd2f9a2c9c7a877111eb1516d3e2ad4f9b104621f0b7f17369c69fcef13d28b85cb6c01d35f09a8845f23
| * | Bugfix: ForceSetArg should replace entr(ies) in mapMultiArgs, not appendLuke Dashjr2017-06-051-0/+1
| |/
* / Remove unused Boost includespracticalswift2017-06-091-3/+0
|/
* Merge #10383: [logging] log system time and mock timeWladimir J. van der Laan2017-05-161-1/+5
|\ | | | | | | | | | | 761392d [logging] log system time and mock time (John Newbery) Tree-SHA512: 0a4b3ad74bcac201be490fe12e4b45adeabc39030ac46f40e1aeb2a20b2f3963e4468e65798d8aaeca1818759cab55ff2b2aa214500aa11571492c3301dd31c1
| * [logging] log system time and mock timeJohn Newbery2017-05-101-1/+5
| |
* | Util: Put mapMultiArgs inside ArgsManagerJorge Timón2017-05-091-6/+5
| | | | | | | | - Set ArgsManager::mapMultiArgs in ArgsManager::SoftSetArg, ForceSetArg, SoftSetBoolArg
* | Util: Create ArgsManager class...Jorge Timón2017-05-091-12/+16
|/ | | | | - Introduce ArgsManager::GetArgs() - Adapt util_tests.cpp to ArgsManager
* Remove Clang workaround for Boost 1.46fanquake2017-04-251-13/+0
|
* allow libevent logging to be updated during runtimeJohn Newbery2017-04-101-1/+1
|
* [rpc] Add logging RPCJohn Newbery2017-04-101-1/+16
| | | | Adds an RPC to get and set currently active logging categories.
* Remove `namespace fs=fs`Wladimir J. van der Laan2017-04-031-4/+0
| | | | Having these inside functions is silly and redundant now.
* Use fsbridge for fopen and freopenWladimir J. van der Laan2017-04-031-5/+5
| | | | | | | 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.
* Replace uses of boost::filesystem with fsWladimir J. van der Laan2017-04-031-28/+28
| | | | | | | | | 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' ```
* Replace includes of boost/filesystem.h with fs.hWladimir J. van der Laan2017-04-031-2/+1
| | | | This is step one in abstracting the use of boost::filesystem.
* Merge #10058: No need to use OpenSSL malloc/freeWladimir J. van der Laan2017-04-031-10/+7
|\ | | | | | | | | | | 6d5dd60 No need to use OpenSSL malloc/free (Thomas Snider) Tree-SHA512: 29f790067ffd5a10a8e1a621318a0ba445691f57c804aa3b7c8ca372c8408d8c7fe703c42b48018e400fc32e3feff5ab401d97433910ce2c50e69da0b8a6662e
| * No need to use OpenSSL malloc/freeThomas Snider2017-03-281-10/+7
| |
* | Change LogAcceptCategory to use uint32_t rather than sets of strings.Gregory Maxwell2017-04-011-28/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | util: Work around (virtual) memory exhaustion on 32-bit w/ glibcWladimir J. van der Laan2017-03-301-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.
* [util] Remove redundant call to get() on smart pointer (thread_specific_ptr)practicalswift2017-03-091-2/+2
|
* Refactor: Remove using namespace <xxx> from util*Karl-Johan Alm2017-03-081-19/+19
|
* Fix for issue #9775. Added check for open() returning a NULL pointer.kirit932017-02-201-7/+8
|
* 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)