Commit graph

122 commits

Author SHA1 Message Date
Gavin Andresen ee3374234c OutputDebugStringF code cleanup
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.
2013-01-01 17:12:30 -05:00
Pieter Wuille 0fb9073edd Split off hash.h from util.h 2012-12-18 21:39:29 +01:00
Gavin Andresen 043a8fb98d Merge pull request #2059 from sipa/benchmark
Add -benchmark for reporting block processing times
2012-12-12 09:14:52 -08:00
Pieter Wuille 3fb9b99cca Allow lengthy block reconnections to be interrupted
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-06 22:04:59 +01:00
Pieter Wuille 0ae0712b1c Add GetTimeMicros() for ore accurate benchmarking 2012-12-05 23:06:01 +01:00
Pieter Wuille 597fa4cd63 Add GetTempPath() to util 2012-11-29 01:00:35 +01:00
Pieter Wuille bba89aa82a Pre-allocate block and undo files in chunks
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-20 23:08:57 +02:00
Wladimir J. van der Laan bcc292b22d Extend printf warnings to error() 2012-10-01 19:45:41 +02:00
Philip Kaufmann 9c8dc7caf1 harmonize printf format characters
- 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-30 11:57:25 +02:00
Pieter Wuille 2e3ffb2d82 Remove stack randomization 2012-09-28 21:53:28 +02:00
Wladimir J. van der Laan 5a1a362215 Merge pull request #1807 from laanwj/2012_09_printf_warnings
Add printf-style warnings to strprintf() and OutputDebugStringF()
2012-09-25 22:56:29 -07:00
Jeff Garzik ea0796bde3 Trim trailing whitespace for src/*.{h,cpp} 2012-09-18 15:07:58 -04:00
Wladimir J. van der Laan 3b3d999618 Add format characters for (s)size_t and ptrdiff_t 2012-09-10 04:25:26 +02:00
Wladimir J. van der Laan ac4e7f6269 HexStr: don't build a vector<char> first
Also const correctness for lookup tables in hex functions throughout the code.
2012-09-10 04:24:57 +02:00
Wladimir J. van der Laan 963af6449f Cleanup some unused macros from util.h
Encapsulate _snprintf/sprintf difference in implementation not header
2012-09-09 15:47:29 +02:00
Wladimir J. van der Laan b0a90fbb0c Add printf-style warnings to strprintf() and OutputDebugStringF()
This finds about ~150 potential problems with format characters on a 64 bit build.
2012-09-09 14:47:31 +02:00
Wladimir J. van der Laan 4d1d94c56c Rename CreateThread to NewThread
Prevent clash with win32 API symbol
2012-08-29 20:25:37 +02:00
Wladimir J. van der Laan 61d8507140 implement CreateThread with boost::thread
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.
2012-08-29 20:02:07 +02:00
Philip Kaufmann efdcf94174 fix further spelling errors / remove a tab in the source 2012-08-02 10:09:29 +02:00
Luke Dashjr 814efd6f1f Bugfix: Fix a variety of misspellings 2012-08-01 17:49:51 +00:00
Giel van Schijndel 96931d6f78 Give threads a recognisable name to aid in debugging
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 <me@mortis.eu>
2012-07-17 01:50:35 +02:00
Pieter Wuille 6ece1d747e CHashWriter that does SHA256 in-place during serialization 2012-07-07 23:09:14 +02:00
Gregory Maxwell 817ee0d826 Merge pull request #1174 from sipa/torhs
Tor hidden service support
2012-06-23 19:21:13 -07:00
Jeff Garzik d62a1947be Merge pull request #1458 from jgarzik/tracenet
Introduce -tracenet option, thereby quieting some redundant debug messages
2012-06-22 10:13:31 -07:00
Jeff Garzik d07eaba195 Introduce -debugnet option, thereby quieting some redundant debug messages
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.
2012-06-22 13:11:57 -04:00
Pieter Wuille c4c99ade65 Base32 encoding/decoding 2012-06-22 17:19:28 +02:00
Gavin Andresen 550c73f4c8 Merge branch 'signbugs' of https://github.com/wizeman/bitcoin
Resolved minor conflict in main.cpp
2012-06-18 10:48:40 -04:00
Ricardo M. Correia 31ac53fbdc Move NOINLINE definition to test where it's used. 2012-06-07 20:22:18 +02:00
Ricardo M. Correia 43346904e1 Don't overflow integer on 32-bit machines.
This was causing test_bitcoin to abort on a 32-bit system likely due to -ftrapv.
2012-06-07 20:22:10 +02:00
Ricardo M. Correia 78e851f94f Fix noinline definition so that it works for more compilers. 2012-05-31 20:33:14 +02:00
Jeff Garzik 429039d45d Refactor: move runCommand() to util.cpp 2012-05-23 23:10:59 -04:00
Gavin Andresen d0e4051cd8 Merge branch 'optimize' 2012-05-22 11:13:00 -04:00
Pieter Wuille 63407fd6e2 Merge pull request #917 from mndrix/reopen-log-file
Reopen log file on SIGHUP
2012-05-21 10:04:26 -07:00
Pieter Wuille 46784d0826 Merge pull request #1354 from fanquake/master
Update Header Licenses
2012-05-20 12:27:50 -07:00
Wladimir J. van der Laan 01ecb074a7 Merge pull request #1302 from laanwj/2012_05_utilstrings
Get rid of snprintf (except one) with fixed buffers, shorten code
2012-05-20 01:30:18 -07:00
Michael Hendricks 9af080c351 Reopen debug.log on SIGHUP
The best log rotation method formerly available was to configure
logrotate with the copytruncate option.  As described in the logrotate
documentation, "there is a very small time slice between copying the
file and truncating it, so some logging data might be lost".

By sending SIGHUP to the server process, one can now reopen the debug
log file without losing any data.
2012-05-18 16:20:03 -06:00
Fordy 3a25a2b9b0 Update License in File Headers
I originally created a pull to replace the "COPYING" in crypter.cpp and
crypter.h, but it turned out that COPYING was actually the correct
file.
2012-05-18 22:02:28 +08:00
Gavin Andresen f718aedd9f Refactor: GetRandHash() method for util 2012-05-17 16:33:27 -04:00
Jeff Garzik 768e5d52fb Add new utility functions FileCommit(), RenameOver() 2012-05-16 19:25:25 -04:00
Wladimir J. van der Laan 29b79e4c0e Get rid of snprintf (except one) with fixed buffers, shorten code
- Use strprintf or vstrprintf instead of snprintf
2012-05-14 20:01:26 +02:00
Wladimir J. van der Laan 67d4cbab46 Move GetStartOnSystemStartup and SetStartOnSystemStartup to GUI code 2012-05-13 12:31:28 +02:00
Pieter Wuille 7f3ccb59da Split synchronization mechanisms from util.{h,cpp} 2012-05-11 18:13:51 +02:00
Pieter Wuille 5456ef3092 Use polling instead of boost's broken semaphore on OSX 2012-05-11 17:02:11 +02:00
Pieter Wuille c59abe2589 Use semaphores instead of condition variables 2012-05-11 17:02:11 +02:00
Jeff Garzik 11b729d8a2 Merge pull request #1134 from Diapolo/util-updates
small util.cpp/h changes
2012-05-09 07:54:25 -07:00
Philip Kaufmann 3e468840bd util.h/.ccp: modifiy some comments / rename MyGetSpecialFolderPath() -> GetSpecialFolderPath(), set fCreate default to true and remove the fallback (not Win >= Vista compatible anyway) / remove namespace fs stuff where only used once / misc small changes' 2012-05-09 12:22:58 +02:00
Matt Corallo 2ea78ec7fd Fix DEBUG_LOCKCONTENTION 2012-05-09 01:41:07 -04:00
Wladimir J. van der Laan 3ee5f8aac3 remove duplicate definition of SecureString in util.h
SecureString was moved to allocators.h in commit 6cb6d62347
2012-05-01 18:49:50 +02:00
Jeff Garzik c2e8c8acd8 Merge pull request #1140 from jgarzik/sign-compare
Address many more sign comparison warnings
2012-04-23 21:33:29 -07:00
Jeff Garzik 735a60698c Change signed->unsigned at 3 code sites
This resolves signed/unsigned comparison warnings.
2012-04-23 14:14:36 -04:00