aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #2618 from fcicq/solaris-supportJeff Garzik2013-08-241-0/+8
|\ | | | | Partial solaris support
| * Add missing constant for solarisfcicq2013-07-171-0/+8
| |
* | Make RPC password resistant to timing attacksGavin Andresen2013-08-081-0/+15
| | | | | | | | | | | | | | Fixes issue#2838; this is a tweaked version of pull#2845 that should not leak the length of the password and is more generic, in case we run into other situations where we need timing-attack-resistant comparisons.
* | Merge pull request #2855 from Diapolo/guard_CreatePidFileGavin Andresen2013-08-051-0/+2
|\ \ | | | | | | exclude CreatePidFile() function on WIN32 as it is unused
| * | exclude CreatePidFile() function on WIN32 as it is unusedPhilip Kaufmann2013-07-241-0/+2
| |/
* / Remove #define loop from util.hGavin Andresen2013-07-311-1/+0
|/ | | | | Replace the loop macro with while (true). The #define caused problems for Qt.
* Dump addresses every 15 minutes instead of 10 secondsPieter Wuille2013-06-241-2/+2
|
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-1/+0
| | | | | | | | | | | | | The new class is accessed via the Params() method and holds most things that vary between main, test and regtest networks. The regtest mode has two purposes, one is to run the bitcoind/bitcoinj comparison tool which compares two separate implementations of the Bitcoin protocol looking for divergence. The other is that when run, you get a local node which can mine a single block instantly, which is highly convenient for testing apps during development as there's no need to wait 10 minutes for a block on the testnet.
* fixed: don't use thread::sleep_for where it's known to be brokentheuni2013-06-141-1/+5
| | | | Fixes #2690.
* fixed: include boost header as necessarytheuni2013-06-131-0/+1
| | | | | | Without this include, sometimes BOOST_VERSION was defined and sometimes it was not, depending on which includes came before it. The result was a random mix of sleep or sleep_for for boost versions >= 1.50.
* changes to thread code (directly use boost::thread)Philip Kaufmann2013-06-101-8/+1
| | | | | | | - removes our NewThread() function an replaces remaining calls with boost::thread with our TraceThread template - remove ExitThread() function - fix THREAD_PRIORITY_ABOVE_NORMAL for non Windows OSes
* remove GetBoolArg() fDefault parameter defaulting to falsePhilip Kaufmann2013-06-011-1/+1
| | | | | | | | - explicitly set the default of all GetBoolArg() calls - rework getarg_test.cpp and util_tests.cpp to cover this change - some indentation fixes - move macdockiconhandler.h include in bitcoin.cpp to the "our headers" section
* Merge pull request #2552 from Diapolo/win-typedefJeff Garzik2013-05-301-2/+0
|\ | | | | remove obsolete and unused typedef for Windows
| * remove obsolete and unused typedef for WindowsPhilip Kaufmann2013-04-231-2/+0
| |
* | Make CPubKey statically allocatedPieter Wuille2013-05-301-1/+2
| |
* | Explicitly #include stdarg.h, for access to va_listRobert Backhaus2013-05-241-0/+2
| |
* | Try to increase file descriptor rlimit if necessaryPieter Wuille2013-04-291-0/+1
|/ | | | As the default can be too low, especially on OSX.
* small indentation, space, formatting fixes (no code changes)Philip Kaufmann2013-04-061-3/+3
|
* Clean up shutdown processGavin Andresen2013-04-031-2/+0
|
* LoopForever and ThreadTrace helpersGavin Andresen2013-04-031-0/+56
|
* Rename util.h Sleep --> MilliSleepGavin Andresen2013-04-031-5/+8
| | | | | | | | Two reasons for this change: 1. Need to always use boost::thread's sleep, even on Windows, so the sleeps can be interrupted (prior code used Windows' built-in Sleep). 2. I always forgot what units the old Sleep took.
* Shutdown cleanup prep-workGavin Andresen2013-04-031-1/+2
| | | | | | | | | | 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/+1
|\ | | | | Native versions for AllocateFileRange()
| * Drop padding in blk* when finalizing filePieter Wuille2013-01-301-0/+1
| |
* | 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-0/+1
|\ \ | |/ |/| Add adjustedtime to getinfo RPC call
| * Add timeoffset to getinfo RPC callPeter Todd2013-01-111-0/+1
| | | | | | | | | | Provides a method to get the difference between network adjusted time and local time from the RPC interface.
* | OutputDebugStringF code cleanupGavin Andresen2013-01-011-1/+1
|/ | | | | | | | | | 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.
* Split off hash.h from util.hPieter Wuille2012-12-181-106/+0
|
* Merge pull request #2059 from sipa/benchmarkGavin Andresen2012-12-121-0/+6
|\ | | | | Add -benchmark for reporting block processing times
| * Add GetTimeMicros() for ore accurate benchmarkingPieter Wuille2012-12-051-0/+6
| |
* | 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/+1
|
* Pre-allocate block and undo files in chunksPieter Wuille2012-10-201-0/+1
| | | | | | | | | 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.
* Extend printf warnings to error()Wladimir J. van der Laan2012-10-011-2/+12
|
* harmonize printf format charactersPhilip Kaufmann2012-09-301-6/+6
| | | | | - remove the "%" character from format characters for (s)size_t and ptrdiff_t and harmonize them with the ones for int64 and uint64
* Remove stack randomizationPieter Wuille2012-09-281-14/+0
|
* Merge pull request #1807 from laanwj/2012_09_printf_warningsWladimir J. van der Laan2012-09-251-15/+45
|\ | | | | Add printf-style warnings to strprintf() and OutputDebugStringF()
| * Add format characters for (s)size_t and ptrdiff_tWladimir J. van der Laan2012-09-101-0/+11
| |
| * HexStr: don't build a vector<char> firstWladimir J. van der Laan2012-09-101-4/+4
| | | | | | | | 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-5/+0
| | | | | | | | Encapsulate _snprintf/sprintf difference in implementation not header
| * Add printf-style warnings to strprintf() and OutputDebugStringF()Wladimir J. van der Laan2012-09-091-6/+30
| | | | | | | | This finds about ~150 potential problems with format characters on a 64 bit build.
* | Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik2012-09-181-2/+2
|/
* 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-52/+1
| | | | | | 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.
* fix further spelling errors / remove a tab in the sourcePhilip Kaufmann2012-08-021-1/+1
|
* Bugfix: Fix a variety of misspellingsLuke Dashjr2012-08-011-1/+1
|
* Give threads a recognisable name to aid in debuggingGiel van Schijndel2012-07-171-3/+1
| | | | | | | | 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]>
* CHashWriter that does SHA256 in-place during serializationPieter Wuille2012-07-071-6/+42
|