aboutsummaryrefslogtreecommitdiff
path: root/src/test/alert_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Re-introduce alert functionality (#1470)Ross Nicoll2018-09-191-0/+198
| | | Re-introduce alert functionality removed from Bitcoin upstream
* Remove bad chain alert partition checkBtcDrak2016-06-141-79/+0
| | | | | | | | | As per meeting 2016-03-31 https://bitcoincore.org/en/meetings/2016/03/31/#bad-chain-alerts The partition checker was producing huge number of false-positives and was disabled in 0.12.1 on the understanding it would either be fixed in 0.13 or removed entirely from master if not.
* FormattingBtcDrak2016-03-181-55/+55
|
* Remove p2p alert handlingBtcDrak2016-03-181-233/+56
|
* Move GetTempPath() to testutil.Mustafa2016-03-111-1/+1
|
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Use BOOST_CHECK_MESSAGE() rather than BOOST_CHECK() in alerts_tests.cpp and ↵Eric Lombrozo2015-10-251-1/+3
| | | | initialize strMiscWarning before calling PartitionCheck()."
* Use unique name for AlertNotify tempfileCasey Rodarmor2015-08-051-2/+2
|
* Includes: Cleanup around net main and walletJorge Timón2015-07-231-4/+1
| | | | | | -Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
* Use best header chain timestamps to detect partitioningGavin Andresen2015-06-081-6/+4
| | | | | | | | 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
* Remove duplicate chainparams.h include from alert_testsMichael Ford2015-05-261-1/+0
|
* Alert if it is very likely we are getting a bad chainGavin Andresen2015-05-141-0/+64
| | | | | | | | | | | | | | | | | | | | 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
* Chainparams: Decouple CAlert from CChainParamsJorge Timón2015-04-041-2/+5
|
* Reinitialize state in between individual unit tests.Pieter Wuille2015-03-031-1/+3
| | | | | 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.
* Merge pull request #5470Wladimir J. van der Laan2014-12-191-1/+1
|\ | | | | | | 78253fc Remove references to X11 licence (Michael Ford)
| * Remove references to X11 licenceMichael Ford2014-12-161-1/+1
| |
* | make all catch() arguments constPhilip Kaufmann2014-12-171-1/+1
|/ | | | | | | - 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
* tests: enable alertnotify test for WindowsCory Fields2014-10-311-5/+11
| | | | | The semantics of "echo" are different there and they change the resulting text, but they're still correct and predictable.
* Separate protocol versioning from clientversionCory Fields2014-10-291-1/+1
|
* boost: split stream classes out of serialize.hCory Fields2014-10-221-0/+1
| | | | serialization now has no dependencies.
* Split up util.cpp/hWladimir J. van der Laan2014-08-261-0/+1
| | | | | | | | | | | | | | | | 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.
* Simplify serialize.h's exception handlingPieter Wuille2014-08-091-1/+1
| | | | | | | | | | | | | | | Remove the 'state' and 'exceptmask' from serialize.h's stream implementations, as well as related methods. As exceptmask always included 'failbit', and setstate was always called with bits = failbit, all it did was immediately raise an exception. Get rid of those variables, and replace the setstate with direct exception throwing (which also removes some dead code). As a result, good() is never reached after a failure (there are only 2 calls, one of which is in tests), and can just be replaced by !eof(). fail(), clear(n) and exceptions() are just never called. Delete them.
* Add licenses for tests and test dataWladimir J. van der Laan2014-03-181-0/+4
| | | | | | | | - Add license headers to source files (years based on commit dates) in `src/test` as well as `qa` - Add `README.md` to `src/test/data` specifying MIT license Fixes #3848
* Test alerts high at high PROTOCOL_VERSIONsGavin Andresen2013-11-111-5/+5
| | | | | | | | | I regenerated the alert test data; now alerts are tested against a protocol version way above the current protocol version. So we won't have to regenerate them every time we bump PROTOCOL_VERSION in the future.
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-5/+9
| | | | | | | | | 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.
* included-tests: generate binary data from test files for inclusion into test ↵Cory Fields2013-09-161-18/+5
| | | | | | | | | | | | | | | | | | | | | | binaries This change moves test data into the binaries rather than reading them from the disk at runtime. Advantages: - Tests become distributable - Cross-compile friendly. Build on one machine and execute in an arbitrary location on another. - Easier testing for backports. Users can verify that tests pass without having to track down corresponding test data. - More trustworthy test results and easier quality assurance as tests make fewer assumptions about their environment. - Tests could theoretically run at client/daemon startup and exit on failure. Disadvantages: - Required 'hexdump' build-dependency. This is a standard bsd tool that should be usable everywhere. It is likely already installed on all build-machines. - Tests can no longer be fudged after build by altering test-data.
* Bugfix: Since test_bitcoin is being built and run inside src/test/, try ↵Luke Dashjr2013-09-101-1/+4
| | | | using relative directories from that point
* -alertnotify=<cmd>Gavin Andresen2013-03-191-29/+82
| | | | | | Runs a shell command when an AppliesToMe() alert is received. %s in the <cmd> string is replaced with the alert.strStatusBar message.
* Some unit tests for CAlertGavin Andresen2013-03-191-0/+132