aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
AgeCommit message (Collapse)Author
2013-11-13Use C99 printf statements in mingwWladimir J. van der Laan
Otherwise, format specifiers such as %llu will not work on XP or earlier. This bug was introduced with 51ed9ec9. http://sourceforge.net/apps/trac/mingw-w64/wiki/gnu%20printf
2013-11-11misc small changes to polish after include cleanupPhilip Kaufmann
2013-11-11Refactor: pull alert string sanitization into utilGavin Andresen
2013-11-10Cleanup code using forward declarations.Brandon Dahler
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
2013-10-30re-work -debug switch handlingPhilip Kaufmann
- re-work -debug help message text - make -debug log every debugging information again (even all categories) - remove unneeded fDebug checks in front of LogPrint()/qDebug(), as that check is done in LogPrintf() when category is != NULL (true for all LogPrint() calls - remove fDebug ONLY in code which is NOT performance-critical - harmonize addrman category name - deprecate -debugnet usage, should be used via -debug=net and remove the corresponding global
2013-10-20Bump Year Number to 2013super3
2013-10-08make fCommandLine a local variable in AppInit()Philip Kaufmann
2013-09-18Replace printf with LogPrintf / LogPrintGavin Andresen
2013-09-18Refactor: OutputDebugStringF -> LogPrint(category, ...)Gavin Andresen
2013-09-09fix some cosmetic glitches in the codebasePhilip Kaufmann
- rename URL into URI in paymentserver where correct - add some missing Qt-coding-stuff in paymentserver - change QSpinBox to QLineEdit as base for BitcoinAmountField in .ui files (as this is the result when converting the BAF back into base) - remove some c_str() and replace with QString::fromStdString() - remove several new-lines - remove unneeded spaces - indentation fixes
2013-09-05autotools: switch to autotools buildsystemCory Fields
2013-08-24Merge pull request #2618 from fcicq/solaris-supportJeff Garzik
Partial solaris support
2013-08-08Make RPC password resistant to timing attacksGavin Andresen
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.
2013-08-05Merge pull request #2855 from Diapolo/guard_CreatePidFileGavin Andresen
exclude CreatePidFile() function on WIN32 as it is unused
2013-07-31Remove #define loop from util.hGavin Andresen
Replace the loop macro with while (true). The #define caused problems for Qt.
2013-07-24exclude CreatePidFile() function on WIN32 as it is unusedPhilip Kaufmann
2013-07-17Add missing constant for solarisfcicq
2013-06-24Dump addresses every 15 minutes instead of 10 secondsPieter Wuille
2013-06-19Introduce a CChainParameters singleton class and regtest mode.Mike Hearn
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.
2013-06-14fixed: don't use thread::sleep_for where it's known to be brokentheuni
Fixes #2690.
2013-06-13fixed: include boost header as necessarytheuni
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.
2013-06-10changes to thread code (directly use boost::thread)Philip Kaufmann
- 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
2013-06-01remove GetBoolArg() fDefault parameter defaulting to falsePhilip Kaufmann
- 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
2013-05-30Merge pull request #2552 from Diapolo/win-typedefJeff Garzik
remove obsolete and unused typedef for Windows
2013-05-30Make CPubKey statically allocatedPieter Wuille
2013-05-24Explicitly #include stdarg.h, for access to va_listRobert Backhaus
2013-04-29Try to increase file descriptor rlimit if necessaryPieter Wuille
As the default can be too low, especially on OSX.
2013-04-23remove obsolete and unused typedef for WindowsPhilip Kaufmann
2013-04-06small indentation, space, formatting fixes (no code changes)Philip Kaufmann
2013-04-03Clean up shutdown processGavin Andresen
2013-04-03LoopForever and ThreadTrace helpersGavin Andresen
2013-04-03Rename util.h Sleep --> MilliSleepGavin Andresen
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.
2013-04-03Shutdown cleanup prep-workGavin Andresen
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.
2013-02-22Merge pull request #2229 from sipa/preallocGavin Andresen
Native versions for AllocateFileRange()
2013-02-22Merge pull request #2312 from gmaxwell/random_randomGavin Andresen
ApproximateBestSubset internal RNG to prevent degenerate behavior.
2013-02-22Merge pull request #2160 from petertodd/add-adjustedtime-to-rpc-getinfoGavin Andresen
Add adjustedtime to getinfo RPC call
2013-02-18Internal RNG for approximateBestSubset to prevent degenerate behavior.Gregory Maxwell
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.
2013-01-30Drop padding in blk* when finalizing filePieter Wuille
2013-01-11Add timeoffset to getinfo RPC callPeter Todd
Provides a method to get the difference between network adjusted time and local time from the RPC interface.
2013-01-01OutputDebugStringF code cleanupGavin Andresen
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.
2012-12-18Split off hash.h from util.hPieter Wuille
2012-12-12Merge pull request #2059 from sipa/benchmarkGavin Andresen
Add -benchmark for reporting block processing times
2012-12-06Allow lengthy block reconnections to be interruptedPieter Wuille
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.
2012-12-05Add GetTimeMicros() for ore accurate benchmarkingPieter Wuille
2012-11-29Add GetTempPath() to utilPieter Wuille
2012-10-20Pre-allocate block and undo files in chunksPieter Wuille
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.
2012-10-01Extend printf warnings to error()Wladimir J. van der Laan
2012-09-30harmonize printf format charactersPhilip Kaufmann
- remove the "%" character from format characters for (s)size_t and ptrdiff_t and harmonize them with the ones for int64 and uint64
2012-09-28Remove stack randomizationPieter Wuille
2012-09-25Merge pull request #1807 from laanwj/2012_09_printf_warningsWladimir J. van der Laan
Add printf-style warnings to strprintf() and OutputDebugStringF()