aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replaced remaining references to "Bitcoin" in translations.Ross Nicoll2014-03-301-1/+1
| | | | | Reverted accidentally changed refernces to "Bitcoin Wiki" in translations. Updated name of dogecoin.pid file to dogecoind.pid in util.cpp to match translations and init.cpp.
* Replaced occurrences of "bitcoin" with "dogecoin" or "Dogecoin" as appropriateRoss Nicoll2014-03-281-5/+5
| | | | (specific, use of "Dogecoin" as a noun are now capitalised).
* Replaced references to Bitcoin with Dogecoin/Dogecoin Core as appropriate.Ross Nicoll2014-03-281-8/+8
|
* Merge branch 'node-bloom-service-bit' of github.com:petertodd/bitcoin into ↵Jannis Froese2014-03-231-0/+1
|\ | | | | | | bloom-todd
| * Add NODE_BLOOM service bit and bump protocol versionPeter Todd2013-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | Lets nodes advertise that they offer bloom filter support explicitly. The protocol version bump allows SPV nodes to assume that NODE_BLOOM is set if NODE_NETWORK is set for pre-70002 nodes. Also adds an undocumented option to turn bloom filter support off for testing purposes. Nodes attempting to use bloom filters are immediately dropped so as to not waste their bandwidth.
* | credit where credit is dueJannis Froese2014-03-221-0/+2
| | | | | | | | (cherry picked from commit 5cdcfa9a2b445dd8f8009f6ff3a8ded4ee6515e6)
* | Protocol changes for Dogecoin 1.5Jannis Froese2014-03-221-5/+47
| | | | | | | | | | | | ported over from Dogecoin and Litecoin (cherry picked from commit 8b09dad2d506fc5a6239863b1c0e33bf7e84da00)
* | Merge pull request #3749Wladimir J. van der Laan2014-02-261-9/+0
|\ \ | | | | | | | | | 4423571 Replace PrintException with PrintExceptionContinue + throw (Wladimir J. van der Laan)
| * | Replace PrintException with PrintExceptionContinue + throwWladimir J. van der Laan2014-02-261-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Just a pet peeve. (PrintException has exactly the same body as PrintExceptionContinue but does a re-throw at the end. Move these re-throws to the call site, this aids understanding what is going on as well as eliminates a bit of code duplication in util.cpp)
* | | Get rid of C99 PRI?64 usage in source filesWladimir J. van der Laan2014-02-241-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amend to d5f1e72. It turns out that BerkelyDB was including inttypes.h indirectly, so we cannot fix this with just macros. Trivial commit: apply the following script to all .cpp and .h files: # Middle sed -i 's/"PRIx64"/x/g' "$1" sed -i 's/"PRIu64"/u/g' "$1" sed -i 's/"PRId64"/d/g' "$1" # Initial sed -i 's/PRIx64"/"x/g' "$1" sed -i 's/PRIu64"/"u/g' "$1" sed -i 's/PRId64"/"d/g' "$1" # Trailing sed -i 's/"PRIx64/x"/g' "$1" sed -i 's/"PRIu64/u"/g' "$1" sed -i 's/"PRId64/d"/g' "$1" After this commit, `git grep` for PRI.64 should turn up nothing except the defines in util.h.
* | Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | | | | | | | | | | | in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
* | Merge pull request #3450Wladimir J. van der Laan2014-01-291-2/+3
|\ \ | | | | | | | | | 4c0b2cd Win32: use a more modern API call in FileCommit() (Philip Kaufmann)
| * | Win32: use a more modern API call in FileCommit()Philip Kaufmann2013-12-201-2/+3
| | | | | | | | | | | | | | | | | | - this seems to be a more recent API call and also supports e.g. SMB3, ReFS, which is not guaranteed for commit_() - link to MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/aa364439%28v=vs.85%29.aspx
* | | Remove redundant .c_str()sWladimir J. van der Laan2014-01-231-5/+5
| | | | | | | | | | | | | | | | | | | | | After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
* | | Typesafe strprintf/error/LogPrint functionsWladimir J. van der Laan2014-01-231-68/+10
|/ / | | | | | | | | | | | | Switch to tinyformat-based formatting. Tinyformat is a typesafe drop-in replacement for C99 printf functions: https://github.com/c42f/tinyformat
* | Remove -logtodebuggerWladimir J. van der Laan2013-12-151-25/+2
| | | | | | | | | | | | | | | | | | `-logtodebugger` is a strange, obscure, WIN32-only (mostly MSVC) thing. Let's clean up the options a bit get rid of it. test_bitcoin was using fLogToDebugger as a way to prevent logging to debug.log. For this, add a boolean (not exposed as option) fLogToDebugLog that defaults to true and is disabled in the tests.
* | Use thread-local storage for LogPrint(category...)Gavin Andresen2013-12-101-9/+15
| | | | | | | | | | | | This prevents crashes at shutdown where a global destructor calls LogPrint(category...) after mapMultiArgs has been deleted.
* | Fix infinite loop with LogPrint on WindowsGavin Andresen2013-12-101-17/+14
| | | | | | | | | | | | | | | | | | Running -printtodebugger -debug (or -debug=lock), compiled with -DDEBUG_LOCKORDER would infinite loop on Windows because every critical section lock/unlock triggers a LogPrint. Solution is to use the raw boost mutex instead of a CCriticalSection.
* | bitcoin-cli: remove unneeded dependencies (only code movement)Wladimir J. van der Laan2013-12-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary dependencies for bitcoin-cli (leveldb, berkelydb, wallet, RPC server) Build system changes: - split libbitcoin.a into libbitcoin_common.a, libbitcoin_server.a and libbitcoin_cli.a Code changes (movement only): - split up HelpMessage into HelpMessage in init.cpp and HelpMessageCli in rpcclient.cpp - move uiInterface from init.cpp to util.cpp
* | core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-2/+0
| | | | | | | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* | Use C99 printf statements in mingwWladimir J. van der Laan2013-11-131-4/+0
| | | | | | | | | | | | | | 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
* | Refactor: pull alert string sanitization into utilGavin Andresen2013-11-111-0/+13
| |
* | Cleanup code using forward declarations.Brandon Dahler2013-11-101-69/+85
| | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #3076 from lano1106/uint256_utilWladimir J. van der Laan2013-11-041-5/+5
|\ \ | | | | | | Make util phexdigit array reusable
| * | Make util phexdigit array reusableOlivier Langlois2013-10-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | class template base_uint had its own private lookup table. This is saving 256 bytes per instantiation. The result is not spectacular as bitcoin-qt has only shrinked of about 1Kb but it is still valid improvement. Also, I have replaced a for loop with a memset() call. Made CBigNum::SetHex() use the new HexDigit() function. Signed-off-by: Olivier Langlois <[email protected]>
* | | Merge pull request #3114Pieter Wuille2013-11-011-1/+4
|\ \ \ | | | | | | | | | | | | a616206 Give peer time-adjustment data an own lock (Pieter Wuille)
| * | | Give peer time-adjustment data an own lockPieter Wuille2013-10-261-1/+4
| | |/ | |/| | | | | | | | | | Instead of relying on cs_main (defined in a different module) to prevent concurrent access to it.
* / | re-work -debug switch handlingPhilip Kaufmann2013-10-301-4/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | - 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
* | Merge pull request #3046 from sarchar/lockedpage-changeGavin Andresen2013-10-201-2/+0
|\ \ | | | | | | Changing LockedPageManager to use a managed instance
| * | Changing LockedPageManager to use a managed instanceChuck2013-10-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures the allocator is ready no matter when it's needed (as some STL implementations allocate in constructors -- i.e., MSVC's STL in debug builds). Using boost::call_once to guarantee thread-safe static initialization. Adding some comments describing why the change was made. Addressing deinitialization of the LockedPageManager object by initializing it in a local static initializer and adding an assert in the base's destructor.
* | | Bump Year Number to 2013super32013-10-201-1/+1
|/ /
* / make fCommandLine a local variable in AppInit()Philip Kaufmann2013-10-081-1/+0
|/
* fix some printf -> LogPrintf leftoversPhilip Kaufmann2013-09-201-10/+2
|
* Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-13/+13
|
* Refactor: OutputDebugStringF -> LogPrint(category, ...)Gavin Andresen2013-09-181-1/+9
|
* More fixes for blockchain corruption on OSX.Gregory Maxwell2013-09-151-0/+2
| | | | | | | | | As we'd previously learned, OSX's fsync is a data eating lie. Since 0.8.4 we're still getting some reports of disk corruption on OSX but now all of it looks like the block files have gotten out of sync with the database. It turns out that we were still using fsync() on the block files, so this isn't surprising.
* GetDataDir(): cache paths for each network separatelyGavin Andresen2013-08-221-11/+18
|
* 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-4/+4
|/ | | | | Replace the loop macro with while (true). The #define caused problems for Qt.
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-3/+3
| | | | | | | | | | | | | 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.
* changes to thread code (directly use boost::thread)Philip Kaufmann2013-06-101-12/+0
| | | | | | | - 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
* Create parent directories if needed in GetDataDirWladimir J. van der Laan2013-06-081-1/+1
| | | | One-line change. Fixes #2752.
* remove GetBoolArg() fDefault parameter defaulting to falsePhilip Kaufmann2013-06-011-4/+3
| | | | | | | | - 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
* 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.