aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Avoid crashes at shutdown due to printf() in global destructors.Gavin Andresen2012-10-041-2/+8
|/
* fix -Wformat warnings all over the sourcePhilip Kaufmann2012-10-011-1/+1
|
* HexStr: don't build a vector<char> firstWladimir J. van der Laan2012-09-101-1/+1
| | | | Also const correctness for lookup tables in hex functions throughout the code.
* Cleanup some unused macros from util.hWladimir J. van der Laan2012-09-091-0/+4
| | | | Encapsulate _snprintf/sprintf difference in implementation not header
* Add printf-style warnings to strprintf() and OutputDebugStringF()Wladimir J. van der Laan2012-09-091-3/+12
| | | | This finds about ~150 potential problems with format characters on a 64 bit build.
* Rename CreateThread to NewThreadWladimir J. van der Laan2012-08-291-1/+1
| | | | Prevent clash with win32 API symbol
* implement CreateThread with boost::threadWladimir J. van der Laan2012-08-291-0/+12
| | | | | | I'm not sure why this wasn't done before. - Removes typedef of pthread_t on Windows, which fixes a native compile issue on mingw.
* Handle locked pages more robustly (Fixes issue #1462)Wladimir J. van der Laan2012-08-231-0/+2
| | | | | | | Memory locks do not stack, that is, pages which have been locked several times by calls to mlock() will be unlocked by a single call to munlock(). This can result in keying material ending up in swap when those functions are used naively. In this commit a class "LockedPageManager" is added that simulates stacking memory locks by keeping a counter per page.
* Restore OSX 10.5 compatibility (do not use pthread_setname_np)Gavin Andresen2012-08-211-2/+5
|
* Suppress output when running unit tests.Gavin Andresen2012-08-201-1/+1
| | | | | | | | This does two things: 1) Now does not output to debug.log if -printtodebugger flag is passed 2) Unit tests set -printtodebugger so only test results are output to stdout Note that -printtodebugger only actually prints to the debugger on Windows.
* Merge pull request #1632 from luke-jr/spellingJeff Garzik2012-08-011-1/+1
|\ | | | | Fix spelling and grammar errors
| * Bugfix: Correct English grammar regarding "'s"Luke Dashjr2012-08-011-1/+1
| |
* | Update Warning-strings to use a standard-formatPhilip Kaufmann2012-08-011-1/+1
|/ | | | | | | | | - ensure warnings always start with "Warning:" and that the first character after ":" is written uppercase - ensure the first sentence in warnings ends with an "!" - remove unneeded spaces from Warning-strings - add missing Warning-string translation - remove a "\n" and replace with untranslatable "<br><br>"
* fix OpenSSL not written as proper noun in some commentsPhilip Kaufmann2012-07-211-3/+3
|
* Teach RenameThread to work on OSXGavin Andresen2012-07-161-0/+2
|
* Don't check for __linux__ specifically, check for PR_SET_NAME feature insteadGiel van Schijndel2012-07-171-1/+1
| | | | Signed-off-by: Giel van Schijndel <[email protected]>
* Add support for renaming FreeBSD and OpenBSD threadsGiel van Schijndel2012-07-171-0/+5
| | | | | | | | NOTE: This is currently disabled, until a developer with FreeBSD/OpenBSD can confirm that this works (without causing undefined behaviour preferrably). Signed-off-by: Giel van Schijndel <[email protected]>
* Give threads a recognisable name to aid in debuggingGiel van Schijndel2012-07-171-0/+12
| | | | | | | | NOTE: These thread names are visible in gdb when using 'info threads'. Additionally both 'top' and 'ps' show these names *unless* told to display the command-line instead of task name. Signed-off-by: Giel van Schijndel <[email protected]>
* Fix a few typosfanquake2012-06-291-1/+1
|
* Merge pull request #1174 from sipa/torhsGregory Maxwell2012-06-231-0/+187
|\ | | | | Tor hidden service support
| * Node support for Tor hidden servicesPieter Wuille2012-06-231-1/+1
| | | | | | | | | | | | This commit adds support for .onion addresses (mapped into the IPv6 by using OnionCat's range and encoding), and the ability to connect to them via a SOCKS5 proxy.
| * Base32 encoding/decodingPieter Wuille2012-06-221-0/+187
| |
* | Introduce -debugnet option, thereby quieting some redundant debug messagesJeff Garzik2012-06-221-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | Prior to this change, each TX typically generated 3+ debug messages, askfor tx 8644cc97480ba1537214 0 sending getdata: tx 8644cc97480ba1537214 askfor tx 8644cc97480ba1537214 1339640761000000 askfor tx 8644cc97480ba1537214 1339640881000000 CTxMemPool::accept() : accepted 8644cc9748 (poolsz 6857) After this change, there is only one message for each valid TX received CTxMemPool::accept() : accepted 22a73c5d8c (poolsz 42) and two messages for each orphan tx received ERROR: FetchInputs() : 673dc195aa mempool Tx prev not found 1e439346fc stored orphan tx 673dc195aa (mapsz 19) The -debugnet option, or its superset -debug, will restore the full debug output.
* Testnet, Mark IIIGavin Andresen2012-05-251-1/+1
|
* Refactor: move runCommand() to util.cppJeff Garzik2012-05-231-0/+8
|
* Merge branch 'optimize'Gavin Andresen2012-05-221-0/+6
|\
| * Refactor: GetRandHash() method for utilGavin Andresen2012-05-171-0/+6
| |
* | Merge pull request #917 from mndrix/reopen-log-filePieter Wuille2012-05-211-0/+12
|\ \ | | | | | | Reopen log file on SIGHUP
| * | Reopen debug.log on SIGHUPMichael Hendricks2012-05-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The best log rotation method formerly available was to configure logrotate with the copytruncate option. As described in the logrotate documentation, "there is a very small time slice between copying the file and truncating it, so some logging data might be lost". By sending SIGHUP to the server process, one can now reopen the debug log file without losing any data.
| * | Serialize access to debug.log streamMichael Hendricks2012-05-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Acquire an exclusive, advisory lock before sending output to debug.log and release it when we're done. This should avoid output from multiple threads being interspersed in the log file. We can't use CRITICAL_SECTION machinery for this because the debug log is written during startup and shutdown when that machinery is not available. (Thanks to Gavin for pointing out the CRITICAL_SECTION problems based on his earlier work in this area)
* | | Merge pull request #1354 from fanquake/masterPieter Wuille2012-05-201-1/+1
|\ \ \ | | | | | | | | Update Header Licenses
| * | | Update License in File HeadersFordy2012-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.
* | | | Make testcases build, prevent windows symbol collisionWladimir J. van der Laan2012-05-201-1/+1
| | | |
* | | | Convert UI interface to boost::signals2.Wladimir J. van der Laan2012-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Signals now go directly from the core to WalletModel/ClientModel. - WalletModel subscribes to signals on CWallet: Prepares for multi-wallet support, by no longer assuming an implicit global wallet. - Gets rid of noui.cpp, the few lines that were left are merged into init.cpp - Rename wxXXX message flags to MF_XXX, to make them UI indifferent. - ThreadSafeMessageBox no longer returns the value `4` which was never used, converted to void.
* | | | Merge pull request #1302 from laanwj/2012_05_utilstringsWladimir J. van der Laan2012-05-201-76/+36
|\ \ \ \ | |_|/ / |/| | | Get rid of snprintf (except one) with fixed buffers, shorten code
| * | | Get rid of snprintf (except one) with fixed buffers, shorten codeWladimir J. van der Laan2012-05-141-76/+36
| | | | | | | | | | | | | | | | - Use strprintf or vstrprintf instead of snprintf
* | | | Use boost::thread locking instead of interprocessPieter Wuille2012-05-181-0/+1
| |/ / |/| |
* | | fix RenameOver() and FileCommit() functions, to not generate compilation errorsPhilip Kaufmann2012-05-171-1/+2
| | |
* | | Add new utility functions FileCommit(), RenameOver()Jeff Garzik2012-05-161-0/+21
| | |
* | | ensure that no double timestamps show up in the debug.log, by removing ↵Philip Kaufmann2012-05-131-1/+1
|/ / | | | | | | manual timestamps from the source (now only -logtimestamps parameter adds timestamps to debug.log)
* | Move GetStartOnSystemStartup and SetStartOnSystemStartup to GUI codeWladimir J. van der Laan2012-05-131-143/+0
| |
* | Split synchronization mechanisms from util.{h,cpp}Pieter Wuille2012-05-111-123/+9
| |
* | Fix osx buildGavin Andresen2012-05-091-1/+1
| |
* | util.h/.ccp: modifiy some comments / rename MyGetSpecialFolderPath() -> ↵Philip Kaufmann2012-05-091-44/+29
| | | | | | | | GetSpecialFolderPath(), set fCreate default to true and remove the fallback (not Win >= Vista compatible anyway) / remove namespace fs stuff where only used once / misc small changes'
* | Merge pull request #1187 from TheBlueMatt/win32_ieWladimir J. van der Laan2012-05-051-1/+1
|\ \ | |/ |/| Update to require IE 5.1 as it is required to build on mingw64.
| * Update to require IE 5.1 as it is required on mingw64.Matt Corallo2012-05-021-1/+1
| | | | | | | | We already require XP, this just fixes Mingw64 build.
* | fix compiler warning "suggest parentheses around assignment used as truthPhilip Kaufmann2012-05-011-1/+1
|/ | | | value [-Wparentheses]" in util.cpp
* Merge pull request #1140 from jgarzik/sign-compareJeff Garzik2012-04-231-1/+1
|\ | | | | Address many more sign comparison warnings
| * Add casts for unavoidable signed/unsigned comparisonsJeff Garzik2012-04-231-1/+1
| | | | | | | | | | At these code sites, it is preferable to cast rather than change a variable's type.
* | Make GetDataDir return absolute pathsPieter Wuille2012-04-221-4/+7
|/