aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* clear path cache after getting a proper config file (fixes #2605)Jonas Schnelli2013-05-021-3/+6
| | | | Signed-off-by: Jonas Schnelli <[email protected]>
* Try to increase file descriptor rlimit if necessaryPieter Wuille2013-04-291-0/+23
| | | | As the default can be too low, especially on OSX.
* Prevent prevent file descriptor leak in ShrinkDebugFile()Tariq Bashir2013-04-271-0/+2
|
* small indentation, space, formatting fixes (no code changes)Philip Kaufmann2013-04-061-9/+9
|
* Clean up shutdown processGavin Andresen2013-04-031-2/+0
|
* Shutdown cleanup prep-workGavin Andresen2013-04-031-3/+6
| | | | | | | | | | Create a boost::thread_group object at the qt/bitcoind main-loop level that will hold pointers to all the main-loop threads. This will replace the vnThreadsRunning[] array. For testing, ported the BitcoinMiner threads to use its own boost::thread_group.
* Merge pull request #2229 from sipa/preallocGavin Andresen2013-02-221-0/+47
|\ | | | | Native versions for AllocateFileRange()
| * Drop padding in blk* when finalizing filePieter Wuille2013-01-301-0/+8
| |
| * Native versions for AllocateFileRange()Pieter Wuille2013-01-301-0/+39
| |
* | Merge pull request #2312 from gmaxwell/random_randomGavin Andresen2013-02-221-6/+20
|\ \ | | | | | | ApproximateBestSubset internal RNG to prevent degenerate behavior.
| * | Internal RNG for approximateBestSubset to prevent degenerate behavior.Gregory Maxwell2013-02-181-6/+20
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes test_bitcoin failures on openbsd reported by dhill on IRC. On some systems rand() is a simple LCG over 2^31 and so it produces an even-odd sequence. ApproximateBestSubset was only using the least significant bit and so every run of the iterative solver would be the same for some inputs, resulting in some pretty dumb decisions. Using something other than the least significant bit would paper over the issue but who knows what other way a system's rand() might get us here. Instead we use an internal RNG with a period of something like 2^60 which is well behaved. This also makes it possible to make the selection deterministic for the tests, if we wanted to implement that.
* | Merge pull request #2160 from petertodd/add-adjustedtime-to-rpc-getinfoGavin Andresen2013-02-221-1/+6
|\ \ | |/ |/| Add adjustedtime to getinfo RPC call
| * Add timeoffset to getinfo RPC callPeter Todd2013-01-111-1/+6
| | | | | | | | | | Provides a method to get the difference between network adjusted time and local time from the RPC interface.
* | OutputDebugStringF code cleanupGavin Andresen2013-01-011-41/+56
|/ | | | | | | | | | Initialize the OutputDebugStringF mutex and file pointer using boost::call_once, to be thread-safe. Make the return value of OutputDebugStringF really be the number of characters written (*printf() semantics). Declare the fReopenDebugLog flag volatile, since it is changed from a signal handler. And don't declare OutputDebugStringF() as inline.
* Remove 'T' from debug log timestampsJeff Garzik2012-12-301-1/+1
| | | | | Space separation between major fields is easier for human eyes and libs to parse.
* Merge pull request #2096 from 94m3k1n9/fix-time-formatsPieter Wuille2012-12-131-1/+1
|\ | | | | Change timestamps to use ISO8601 formatting
| * Change timestamps to use ISO8601 formattingRichard Schwab2012-12-121-1/+1
| |
* | Allow lengthy block reconnections to be interruptedPieter Wuille2012-12-061-1/+1
|/ | | | | | | | | When the coin database is out of date with the block database, the best block in it is automatically switched to. This reconnection process can take time, so allow it to be interrupted. This also stops block connection as soon as shutdown is requested, leading to a faster shutdown.
* Add GetTempPath() to utilPieter Wuille2012-11-291-0/+22
|
* update CClientUIInterface and remove orphan Wx stuffPhilip Kaufmann2012-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | - fix ThreadSafeMessageBox always displays error icon - allow to specify MSG_ERROR / MSG_WARNING or MSG_INFORMATION without a custom caption / title - allow to specify CClientUIInterface::ICON_ERROR / ICON_WARNING and ICON_INFORMATION (which is default) as message box icon - remove CClientUIInterface::OK from ThreadSafeMessageBox-calls, as the OK button will be set as default, if none is specified - prepend "Bitcoin - " to used captions - rename BitcoinGUI::error() -> BitcoinGUI::message() and add function documentation - change all style parameters and enum flags to unsigned - update code to use that new API - update Client- and WalletModel to use new BitcoinGUI::message() and rename the classes error() method into message() - include the possibility to supply the wanted icon for messages from Client- and WalletModel via "style" parameter
* don't use memset() in privacy/security relevant code partsPhilip Kaufmann2012-11-091-1/+1
| | | | | | | | | | | | As memset() can be optimized out by a compiler it should not be used in privacy/security relevant code parts. OpenSSL provides the safe OPENSSL_cleanse() function in crypto.h, which perfectly does the job of clean and overwrite data. For details see: http://www.viva64.com/en/b/0178/ - change memset() to OPENSSL_cleanse() where appropriate - change a hard-coded number from netbase.cpp into a sizeof()
* Pre-allocate block and undo files in chunksPieter Wuille2012-10-201-0/+14
| | | | | | | | | Introduce a AllocateFileRange() function in util, which wipes or at least allocates a given range of a file. It can be overriden by more efficient OS-dependent versions if necessary. Block and undo files are now allocated in chunks of 16 and 1 MiB, respectively.
* Merge pull request #1879 from sipa/fdatasyncWladimir J. van der Laan2012-10-111-0/+4
|\ | | | | Use fdatasync instead of fsync on supported platforms
| * Use fdatasync instead of fsync on supported platformsPieter Wuille2012-10-071-0/+4
| |
* | Merge pull request #1901 from laanwj/2012_10_remove_strlcpyWladimir J. van der Laan2012-10-111-15/+16
|\ \ | | | | | | get rid of strlcpy.h
| * | get rid of strlcpy.hWladimir J. van der Laan2012-10-071-15/+16
| |/ | | | | | | | | Don't use hand-rolled string manipulation routine with a fixed buffer in the bitcoin core, instead make use of c++ strings and boost.
* / 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
|