Commit graph

227 commits

Author SHA1 Message Date
Chirag Davé 326231611b fReopenDebugLog and fRequestShutdown should be type sig_atomic_t
This allows access as an atomic variable in the presence
of async interrupts.

See issue #7433 for more details
fixes: #7433
2016-05-09 08:20:58 -07:00
Mustafa 2fdaa25529 Move GetTempPath() to testutil. 2016-03-11 15:04:05 +00:00
Luke Dashjr a68bb9f5e7 Merge branch 'master' into single_prodname 2016-02-03 05:41:13 +00:00
Luke Dashjr 027fdb83b4 When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen 2016-02-03 05:38:51 +00:00
Luke Dashjr 917b1d03cf Set copyright holders displayed in notices separately from the package name
This helps avoid accidental removal of upstream copyright names
2015-12-22 12:29:18 +00:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
MarcoFalke fa41d4c8c6 [qt] Move GUI related HelpMessage() part downstream 2015-11-28 19:01:26 +01:00
MarcoFalke faf93f37fe [trivial] Reuse translation and cleanup DEFAULT_* values
* DEFAULT_DISABLE_SAFEMODE = false
* Use DEFAULT_* constants for extern bools
2015-11-28 19:01:11 +01:00
Luke Dashjr b966aa836a Constrain constant values to a single location in code 2015-11-28 18:47:29 +01:00
Suhas Daftuar 7bbc7c314f Add option for microsecond precision in debug.log 2015-10-26 15:05:37 -04:00
Wladimir J. van der Laan 26c9b83677 Move windows socket init to utility function 2015-09-03 10:59:19 +02:00
Adam Weiss 27d7605804 Buffer log messages and explicitly open logs
Prevents stomping on debug logs in datadirs that are locked by other
instances and lost parameter interaction messages that can get wiped by
ShrinkDebugFile().

The log is now opened explicitly and all emitted messages are buffered
until this open occurs.  The version message and log cut have also been
moved to the earliest possible sensible location.
2015-07-06 21:54:31 -04:00
Wladimir J. van der Laan 47162673c7 Use real number of cores for default -par, ignore virtual cores
To determine the default for `-par`, the number of script verification
threads, use [boost:🧵:physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency)
which counts only physical cores, not virtual cores.

Virtual cores are roughly a set of cached registers to avoid context
switches while threading, they cannot actually perform work, so spawning
a verification thread for them could even reduce efficiency and will put
undue load on the system.

Should fix issue #6358, as well as some other reported system overload
issues, especially on Intel processors.

The function was only introduced in boost 1.56, so provide a utility
function `GetNumCores` to fall back for older Boost versions.
2015-07-01 18:01:16 +02:00
Philip Kaufmann a9ac95c1bc use const references where appropriate 2015-06-04 19:34:18 +02:00
Gavin Andresen 9a1dcea2df
Use CScheduler for net's DumpAddresses
Instead of starting Yet Another Thread to dump addresses,
use CScheduler to do it.
2015-05-14 12:50:42 -04:00
Jorge Timón b74dcb3b4a Separate CTranslationInterface from CClientUIInterface 2015-04-16 19:58:48 +02:00
Luca Venturini 1fdb9fa3f9 Help messages correctly formatted (79 chars)
Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format works even if the translation of the strings
modifies the lenght of the message.

Sqashed 6 commits in a single one.
Help messages correctly formatted for SVGA text mode (132 chars)

Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format should work even if the translation of the strings
modifies the lenght of the message.

Fix - syntax error

Correct formatting for 79 chars

Correctly based on C++ functions

Removed spare spaces from option strings

Fix - syntax error
2015-03-10 22:07:17 -07:00
Pieter Wuille 51598b2631 Reinitialize state in between individual unit tests.
This changes the TestingSetup fixture to be per-unit-test rather than global.
Most tests don't need it, so it's only invoked in a few.
2015-03-03 09:01:46 -08:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Philip Kaufmann 27df4123c4 make all catch() arguments const
- I saw this on http://en.cppreference.com/w/cpp/language/try_catch and
  thought it would be a good idea
- also unify used format to better be able to search for exception
  uses in our codebase
2014-12-17 09:39:24 +01:00
Michael Ford c63a73d18a Update comments in util to be doxygen compatible 2014-11-17 11:04:01 +08:00
Philip Kaufmann e2efdf3937 amount.h: update license, add header end comment + rem from util.h 2014-10-02 11:25:21 +02:00
Mark Friedenbach a372168e77 Use a typedef for monetary values 2014-09-26 15:42:04 -07:00
Wladimir J. van der Laan d6712db354
Also create pid file in non-daemon mode
Always make a pid file, not only when `-daemon` specified.

This is useful for troubleshooting, for attaching debuggers and loggers
and such.

- Write the pid file only after the datadir lock was acquired
- Don't create or remove a pid file on WIN32, and also don't show the option
2014-09-20 11:03:59 +02:00
Philip Kaufmann 611116d4e3 header include cleanup
- ensures alphabetical ordering for includes etc. in source file headers
2014-09-14 12:43:56 +02:00
Philip Kaufmann 093303a887 add missing header end comments
- ensures a consistent usage in header files
- also add a blank line after the copyright header where missing
- also remove orphan new-lines at the end of some files
2014-08-28 22:25:21 +02:00
Wladimir J. van der Laan ad49c256c3 Split up util.cpp/h
Split up util.cpp/h into:

- string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach)
- money utilities (parsesmoney, formatmoney)
- time utilities (gettime*, sleep, format date):
- and the rest (logging, argument parsing, config file parsing)

The latter is basically the environment and OS handling,
and is stripped of all utility functions, so we may want to
rename it to something else than util.cpp/h for clarity (Matt suggested
osinterface).

Breaks dependency of sha256.cpp on all the things pulled in by util.
2014-08-26 13:25:22 +02:00
Wladimir J. van der Laan f841aa2892 Move COIN and CENT to core.h
Eventually these should end up in `money.h` after monetary
amounts are typedef'ed, but at least they don't belong in `util.h`.
2014-08-26 13:25:22 +02:00
Wladimir J. van der Laan 6e5fd003e0 Move *Version() functions to version.h/cpp 2014-08-26 13:25:21 +02:00
Wladimir J. van der Laan b4aa769bcb Move S_I* constants and MSG_NOSIGNAL to compat.h 2014-08-26 13:25:21 +02:00
Wladimir J. van der Laan 610a8c0759 Move SetThreadPriority implementation to util.cpp instead of the header
Put the THREAD_* and PRIO_ constants in compat.h.
2014-08-26 13:25:21 +02:00
Wladimir J. van der Laan f780e65ac6 Remove unused function ByteReverse from util.h 2014-08-26 13:25:21 +02:00
Wladimir J. van der Laan 121d6ad9db Remove unused alignup function from util.h 2014-08-26 13:25:21 +02:00
Wladimir J. van der Laan d1e26d4e71 Move CMedianFilter to timedata.cpp
Now that we no longer use the median filter to keep track of
the number of blocks of peers, that's the only place it is used.
2014-08-26 13:25:20 +02:00
Wladimir J. van der Laan 9b6d4c5cdc Move strprintf define to tinyformat.h
This avoids a dependency on util.h if just tinyformat is needed.
2014-08-20 10:51:18 +02:00
Philip Kaufmann 6354935c48 move rand functions from util to new random.h/.cpp 2014-07-09 09:42:19 +02:00
Philip Kaufmann 001a53d742 add GetRandBytes() as wrapper for RAND_bytes()
- add a small wrapper in util around RAND_bytes() and replace with
  GetRandBytes() in the code to log errors from calling RAND_bytes()
- remove OpenSSL header rand.h where no longer needed
2014-07-09 09:42:18 +02:00
R E Broadley 2e36866fec Show nodeid instead of addresses (for anonymity) unless otherwise requested. 2014-07-04 09:38:44 +07:00
Pieter Wuille de79aaa7a9 Move non-trivial uint256.h methods to uint256.cpp 2014-06-28 18:02:42 +02:00
Wladimir J. van der Laan 14f888ca80 Move network-time related functions to timedata.cpp/h
The network time-offset-mangement functions from util.cpp are moved to
timedata.(cpp|h). This breaks the dependency of util on netbase.
2014-06-25 09:24:50 +02:00
Cory Fields f3967bcc50 build: fix build weirdness after 54372482.
bitcoin-config.h moved, but the old file is likely to still exist when
reconfiguring or switching branches. This would've caused files to not rebuild
correctly, and other strange problems.

Make the path explicit so that the old one cannot be found.

Core libs use config/bitcoin-config.h.

Libs (like crypto) which don't want access to bitcoin's headers continue
to use -Iconfig and #include bitcoin-config.h.
2014-06-23 14:04:38 -04:00
Wladimir J. van der Laan 97789d374c util: Add function FormatParagraph to format paragraph to fixed-width
This is to be used for the `-version` and `-help` messages.
2014-06-11 14:27:09 +02:00
Wladimir J. van der Laan 6dd5edb7de
Remove unused Print/PrintHex functions
You can just use HexStr(script) or script.ToString() for debugging, no
need for these extra functions.
2014-06-10 15:03:21 +02:00
Philip Kaufmann 53a088154c rename fNoListen to fListen and move to net
- better code readability and it belongs to net
- this is a prerequisite for a pull to add -listen to the GUI
2014-05-29 14:01:39 +02:00
Wladimir J. van der Laan 0f1040ba52
Merge pull request #4183
f40dbee remove CPubKey::VerifyCompact( ) which is never used (Kamil Domanski)
28b6c1d remove GetMedianTime( ) which is never used (Kamil Domanski)
5bd4adc remove LookupHostNumeric( ) which is never used (Kamil Domanski)
595f691 remove LogException( ) which is never used (Kamil Domanski)
f4057cb remove CTransaction::IsNewerThan which is never used (Kamil Domanski)
0e31e56 remove CWallet::AddReserveKey which is never used (Kamil Domanski)
2014-05-25 16:19:54 +02:00
Wladimir J. van der Laan 3e8ac6af9a
Replace non-threadsafe gmtime and setlocale
Make DateTimeStrFormat use boost::posix_time.

Also re-enable the util_DateTimeStrFormat tests, as they are no
longer platform specific.
2014-05-23 15:23:11 +02:00
Kamil Domanski 595f691d0a remove LogException( ) which is never used 2014-05-20 14:58:21 +02:00
Wladimir J. van der Laan c26acfc308
Merge pull request #4174
5248ff4 SetupEnvironment() - clean commit (Stuart Cardall)
2014-05-19 15:08:48 +02:00
Stuart Cardall 5248ff4099 SetupEnvironment() - clean commit 2014-05-13 10:15:00 +00:00
Kamil Domanski be54b87f22 remove ParseString(...) which is never used 2014-05-13 12:00:24 +02:00