Commit graph

646 commits

Author SHA1 Message Date
Wladimir J. van der Laan ca37e0f339
Merge pull request #5697
60c8bac Includes: Cleanup around net main and wallet (Jorge Timón)
9dd793f TRIVIAL: Missing includes (Jorge Timón)
2015-07-27 14:40:29 +02:00
Jorge Timón 9dd793f499 TRIVIAL: Missing includes 2015-07-23 21:10:22 +02:00
Wladimir J. van der Laan 633fe10869
Merge pull request #6149
27d7605 Buffer log messages and explicitly open logs (Adam Weiss)
2015-07-22 18:24:20 +02:00
Wladimir J. van der Laan 445220544e
Merge pull request #5288
e3cae52 Added -whiteconnections=<n> option (Josh Lehan)
2015-07-10 15:07:15 +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 9546a977d3
Merge pull request #6335
9238ecb Policy: MOVEONLY: 3 functions to policy.o: (Luke Dashjr)
627b9de Policy: MOVEONLY: Create policy/policy.h with some constants (Jorge Timón)
2015-07-06 18:54:20 +02:00
Wladimir J. van der Laan d0a10c1959
Merge pull request #6329
0c37634 acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only (Luke Dashjr)
2015-07-03 14:00:06 +02:00
Luke Dashjr 0c376340a4 acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only 2015-07-03 08:29:16 +00:00
Wladimir J. van der Laan d7ada03b8a
Merge pull request #6361
4716267 Use real number of cores for default -par, ignore virtual cores (Wladimir J. van der Laan)
2015-07-02 20:01:04 +02: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
Jonas Schnelli d0fc10a844 detach wallet from miner 2015-06-30 21:45:46 +02:00
Jorge Timón 627b9deff4 Policy: MOVEONLY: Create policy/policy.h with some constants 2015-06-26 17:59:07 +02:00
Gavin Andresen 6a4b97e863
Testing infrastructure: mocktime fixes
New, undocumented-on-purpose -mocktime=timestamp command-line
argument to startup with mocktime set. Needed because
time-related blockchain sanity checks are done on startup, before a
test has a chance to make a setmocktime RPC call.

And changed the setmocktime RPC call so calling it will not result in
currently connected peers being disconnected due to inactivity timeouts.
2015-06-24 15:18:55 -04:00
Wladimir J. van der Laan 40400d53d3
Merge pull request #6272
edbdf88 tests: Extend RPC proxy tests (Wladimir J. van der Laan)
baf0507 Improve proxy initialization (Wladimir J. van der Laan)
2015-06-18 17:53:36 +02:00
Wladimir J. van der Laan c1fb0e1075
Merge pull request #6274
02a6702 Add option `-alerts` to opt out of alert system (Wladimir J. van der Laan)
2015-06-15 09:57:33 +02:00
Wladimir J. van der Laan 02a6702a82 Add option -alerts to opt out of alert system
Make it possible to opt-out of the centralized alert system by providing
an option `-noalerts` or `-alerts=0`. The default remains unchanged.

This is a gentler form of #6260, in which I went a bit overboard by
removing the alert system completely.

I intend to add this to the GUI options in another pull after this.
2015-06-15 09:53:33 +02:00
Josh Lehan e3cae52538 Added -whiteconnections=<n> option
This sets aside a number of connection slots for whitelisted peers,
useful for ensuring your local users and miners can always get in,
even if your limit on inbound connections has already been reached.
2015-06-14 02:07:15 -07:00
Wladimir J. van der Laan 8ccc07c077
Merge pull request #6256
65b9454 Use best header chain timestamps to detect partitioning (Gavin Andresen)
2015-06-12 16:44:36 +02:00
Wladimir J. van der Laan baf05075fa Improve proxy initialization
Simplify and make the code in AppInit2 more clear.

This provides a straightforward flow, gets rid of .count() (which makes
it possible to override an earlier provided proxy option to nothing), as
well as comments the different cases.
2015-06-12 12:41:44 +02:00
Wladimir J. van der Laan dd8fe8215a
Merge pull request #6221
c257a8c Prune: Support noncontiguous block files (Adam Weiss)
2015-06-11 18:24:35 +02:00
Wladimir J. van der Laan 51870fc151
Merge pull request #6264
9b5659d Remove translation for -help-debug options (Wladimir J. van der Laan)
2015-06-11 10:50:01 +02:00
Wladimir J. van der Laan ac5476e2c1
Merge pull request #6057
7e6569e [squashme] improve/corrects prune mode detection test for required wallet rescans (Jonas Schnelli)
7a12119 [RPC] disable import functions in pruned mode (Jonas Schnelli)
3201035 [autoprune] allow wallet in pruned mode (Jonas Schnelli)
2015-06-10 12:32:31 +02:00
Wladimir J. van der Laan 9b5659d1c4 Remove translation for -help-debug options
Do not translate -help-debug options, Many technical terms, and
only a very small audience, so is unnecessary stress to translators.

Brings the code up to date with translation string policy in
`doc/translation_strings_policy.md`.

Also remove no-longer-relevant "In this mode -genproclimit controls how
many blocks are generated immediately." (as of #5957) from regtest help.
2015-06-10 11:59:23 +02:00
Wladimir J. van der Laan e54ff2fc0e
Merge pull request #6213
eebd4cc [init] add -blockversion help and extend -upnp help (Philip Kaufmann)
2015-06-10 11:39:06 +02:00
Wladimir J. van der Laan 8d9f0a6069
Merge pull request #5927
dce8360 Reduce checkpoints' effect on consensus. (Pieter Wuille)
2015-06-10 10:33:12 +02:00
Gavin Andresen 65b9454503
Use best header chain timestamps to detect partitioning
The partition checking code was using chainActive timestamps
to detect partitioning; with headers-first syncing, it should use
(and with this pull request, does use) pIndexBestHeader timestamps.

Fixes issue #6251
2015-06-08 16:34:58 -04:00
Philip Kaufmann a9ac95c1bc use const references where appropriate 2015-06-04 19:34:18 +02:00
Adam Weiss c257a8c9a6 Prune: Support noncontiguous block files
In some corner cases, it may be possible for recent blocks to end up in
the same block file as much older blocks.  Previously, the pruning code
would stop looking for files to remove upon first encountering a file
containing a block that cannot be pruned, now it will keep looking for
candidate files until the target is met and all other criteria are
satisfied.

This can result in a noncontiguous set of block files (by number) on
disk, which is fine except for during some reindex corner cases, so
make reindex preparation smarter such that we keep the data we can
actually use and throw away the rest.  This allows pruning to work
correctly while downloading any blocks needed during the reindex.
2015-06-03 13:25:33 -04:00
Wladimir J. van der Laan f00b62391b
Merge pull request #6203
d449772 Remove P2SH coinbase flag, no longer interesting (Luke Dashjr)
2015-06-02 09:11:13 +02:00
Philip Kaufmann eebd4cca19 [init] add -blockversion help and extend -upnp help 2015-06-01 14:38:44 +02:00
Wladimir J. van der Laan 8d05ec7bda
Merge pull request #6164
aa41bc8 Update help message to match the #4219 change (lpescher)
f60bb5e Update documentation to match the #4219 change (lpescher)
cb87386 Make command line option to show all debugging consistent with similar options (lpescher)
2015-06-01 11:26:59 +02:00
Luke Dashjr d449772cf6 Remove P2SH coinbase flag, no longer interesting 2015-05-31 06:53:48 +00:00
Jonas Schnelli 7e6569ea5b [squashme] improve/corrects prune mode detection test for required wallet rescans 2015-05-28 09:00:45 +02:00
Jonas Schnelli 3201035f22 [autoprune] allow wallet in pruned mode 2015-05-28 09:00:45 +02:00
Wladimir J. van der Laan c7c9af381c
Merge pull request #5669
da29ecb Consensus: MOVEONLY: Move CValidationState from main consensus/validation (jtimon)
27afcd8 Consensus: Refactor: Decouple CValidationState from main::AbortNode() (Cory Fields)
2015-05-27 15:00:02 +02:00
Wladimir J. van der Laan 0bcf04f046
Merge pull request #6153
8c35b6f Parameter interaction: disable upnp if -proxy set (Wladimir J. van der Laan)
2015-05-27 09:33:01 +02:00
Wladimir J. van der Laan e9af4e65b5
Merge pull request #5947
36cba8f Alert if it is very likely we are getting a bad chain (Gavin Andresen)
2015-05-26 10:41:17 +02:00
Wladimir J. van der Laan e1412d3e96
Merge pull request #6159
ffdda4e Catch errors on datadir lock and pidfile delete (Adam Weiss)
2015-05-24 10:57:22 +02:00
Adam Weiss ffdda4e8a7 Catch errors on datadir lock and pidfile delete
Prevents bad permissions (or other fs related problems) from resulting
in hard crashes with cryptic messages on startup and shutdown.
2015-05-22 14:15:22 -04:00
lpescher aa41bc84b1 Update help message to match the #4219 change 2015-05-19 22:35:11 -06:00
Wladimir J. van der Laan 8c35b6f3be Parameter interaction: disable upnp if -proxy set
To protect privacy, do not use UPNP when a proxy is set. The user may
still specify -listen=1 to listen locally (for a hidden service), so
don't rely on this happening through -listen.

Fixes #2927.
2015-05-18 11:22:39 +02:00
Wladimir J. van der Laan 77ed59df4d wallet: Introduce constant for -txconfirmtarget default 2015-05-18 09:00:24 +02:00
jtimon da29ecbcc6 Consensus: MOVEONLY: Move CValidationState from main consensus/validation 2015-05-15 16:05:28 +02:00
Wladimir J. van der Laan e47c94e64c
Merge pull request #6135
f13dac9 Comment edits and cleanup (BitcoinPRReadingGroup)
ff734e9 Alphabetic order in makefile (Jorge Timón)
5207f33 fix header include groups (Philip Kaufmann)
59b149f remove unneeded incude of wallet/db.h from rpcmining.cpp (Philip Kaufmann)
3703385 remove unused classes from db.h (Philip Kaufmann)
0a7bcb7 fix IDE/compiler warning "extra ';'" in validationinterface.h (Philip Kaufmann)
3b00e7c [Trivial] Update COPYING (sandakersmann)
dd9e688 Trivial: Corrected owner of DNS seeder (ayeowch)
a60bfd8 [init] better message when no wallet support is compiled in (Philip Kaufmann)
78f44b6 Capitalized P2P (sandakersmann)
8e9248d [Trivial] Cryptocurrency is one word (sandakersmann)
803f51e Typo in GetRawMemPool RPC method help: "]" --> "}" (Chris Arnesen)
605a735 addrman: update comments (Pavel Vasin)
2015-05-15 13:59:07 +02:00
Wladimir J. van der Laan 6fb90d8983
Merge pull request #6102
86a5f4b Relocate calls to CheckDiskSpace (Alex Morcos)
67708ac Write block index more frequently than cache flushes (Pieter Wuille)
b3ed423 Cache tweak and logging improvements (Pieter Wuille)
fc684ad Use accurate memory for flushing decisions (Pieter Wuille)
046392d Keep track of memory usage in CCoinsViewCache (Pieter Wuille)
540629c Add memusage.h (Pieter Wuille)
2015-05-15 13:43:02 +02:00
Gavin Andresen 36cba8f118
Alert if it is very likely we are getting a bad chain
Create a monitoring task that counts how many blocks have been found in the last four hours.

If very few or too many have been found, an alert is triggered.

"Very few" and "too many" are set based on a false positive rate of once every fifty years of constant running with constant hashing power, which works out to getting 5 or fewer or 48 or more blocks in four hours (instead of the average of 24).

Only one alert per day is triggered, so if you get disconnected from the network (or are being Sybil'ed) -alertnotify will be triggered after 3.5 hours but you won't get another -alertnotify for 24 hours.

Tested with a new unit test and by running on the main network with -debug=partitioncheck

Run test/test_bitcoin --log_level=message to see the alert messages:
    WARNING: check your network connection, 3 blocks received in the last 4 hours (24 expected)
    WARNING: abnormally high number of blocks generated, 60 blocks received in the last 4 hours (24 expected)

The -debug=partitioncheck debug.log messages look like:
    ThreadPartitionCheck : Found 22 blocks in the last 4 hours
    ThreadPartitionCheck : likelihood: 0.0777702
2015-05-14 14:58:44 -04:00
Gavin Andresen b4c219b622
Merge pull request #5964
9a1dcea Use CScheduler for net's DumpAddresses (Gavin Andresen)
ddd0acd Create a scheduler thread for lightweight tasks (Gavin Andresen)
68d370b CScheduler unit test (Gavin Andresen)
cfefe5b scheduler: fix with boost <= 1.50 (Cory Fields)
ca66717 build: make libboost_chrono mandatory (Cory Fields)
928b950 CScheduler class for lightweight task scheduling (Gavin Andresen)
e656560 [Qt] add defaultConfirmTarget constant to sendcoinsdialog (Philip Kaufmann)
2015-05-14 14:27:07 -04: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
Gavin Andresen ddd0acd3db
Create a scheduler thread for lightweight tasks 2015-05-14 12:50:41 -04:00
Philip Kaufmann a60bfd810f [init] better message when no wallet support is compiled in 2015-05-14 01:02:00 -04:00