aboutsummaryrefslogtreecommitdiff
path: root/src/test/DoS_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-12/+14
| | | | | | | | | 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.
* Simplify storage of orphan transactionsGavin Andresen2013-08-021-20/+9
| | | | | | | | | Orphan transactions were stored as a CDataStream pointer; this changes the mapOrphanTransactions data structures to store orphans as a CTransaction. This also fixes CVE-2013-4627 by always re-serializing transactions before relaying them.
* Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-191-1/+2
| | | | | | | | | | | | | 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.
* Introduce script verification flagsPieter Wuille2012-11-151-5/+6
| | | | | | | | These flags select features to be enabled/disabled during script evaluation/checking, instead of several booleans passed along. Currently these flags are defined: * SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation * SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.
* change blockchain -> block chain (spelling)Philip Kaufmann2012-10-211-3/+2
| | | | | - Wiki says "block chain" is correct ;) - remove some unneeded spaces I found in the source, while fixing the spelling
* UltraprunePieter Wuille2012-10-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches bitcoin's transaction/block verification logic to use a "coin database", which contains all unredeemed transaction output scripts, amounts and heights. The name ultraprune comes from the fact that instead of a full transaction index, we only (need to) keep an index with unspent outputs. For now, the blocks themselves are kept as usual, although they are only necessary for serving, rescanning and reorganizing. The basic datastructures are CCoins (representing the coins of a single transaction), and CCoinsView (representing a state of the coins database). There are several implementations for CCoinsView. A dummy, one backed by the coins database (coins.dat), one backed by the memory pool, and one that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock, DisconnectBlock, ... now operate on a generic CCoinsView. The block switching logic now builds a single cached CCoinsView with changes to be committed to the database before any changes are made. This means no uncommitted changes are ever read from the database, and should ease the transition to another database layer which does not support transactions (but does support atomic writes), like LevelDB. For the getrawtransaction() RPC call, access to a txid-to-disk index would be preferable. As this index is not necessary or even useful for any other part of the implementation, it is not provided. Instead, getrawtransaction() uses the coin database to find the block height, and then scans that block to find the requested transaction. This is slow, but should suffice for debug purposes.
* Check for canonical public keys and signaturesPieter Wuille2012-09-211-5/+5
| | | | Only enabled inside tests for now.
* Bugfix: Fix a variety of misspellingsLuke Dashjr2012-08-011-1/+1
|
* Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddressPieter Wuille2012-05-241-5/+5
| | | | | | | | | | | | | | | | | This introduces internal types: * CKeyID: reference (hash160) of a key * CScriptID: reference (hash160) of a script * CTxDestination: a boost::variant of the former two CBitcoinAddress is retrofitted to be a Base58 encoding of a CTxDestination. This allows all internal code to only use the internal types, and only have RPC and GUI depend on the base58 code. Furthermore, the header dependencies are a lot saner now. base58.h is at the top (right below rpc and gui) instead of at the bottom. For the rest: wallet -> script -> keystore -> key. Only keystore still requires a forward declaration of CScript. Solving that would require splitting script into two layers.
* DoS_tests: fix signed/unsigned comparison warningsJeff Garzik2012-05-241-7/+7
| | | | | | | | | | | test/DoS_tests.cpp: In member function ‘void DoS_tests::DoS_mapOrphans::test_method()’: test/DoS_tests.cpp:200:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] test/DoS_tests.cpp:208:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] test/DoS_tests.cpp: In member function ‘void DoS_tests::DoS_checkSig::test_method()’: test/DoS_tests.cpp:260:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] test/DoS_tests.cpp:267:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] test/DoS_tests.cpp:280:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] test/DoS_tests.cpp:307:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
* Merge branch 'optimize'Gavin Andresen2012-05-221-13/+122
|\
| * Cache signature verificationsGavin Andresen2012-05-181-1/+92
| | | | | | | | | | | | | | | | | | Create a maximum-10MB signature verification result cache. This should almost double the number of transactions that can be processed on a given CPU, because before this change ECDSA signatures were verified when transactions were added to the memory pool and then again when they appeared in a block.
| * Optimize orphan transaction handlingGavin Andresen2012-05-181-2/+28
| | | | | | | | | | Changes suggested by Sergio Demian Lerner to help prevent potential DoS attacks.
| * Refactor: GetRandHash() method for utilGavin Andresen2012-05-171-10/+2
| |
* | Support for multiple local addressesPieter Wuille2012-05-041-4/+4
|/
* SigOp and orphan-tx constants and counts are always unsigned.Jeff Garzik2012-04-231-1/+1
| | | | Fixes several sign-comparison warnings.
* Fix tests after recent refactorsPieter Wuille2012-04-171-2/+2
|
* DoS fix for mapOrphanTransactionsv0.6.0rc2Gavin Andresen2012-02-291-0/+79
|
* Network stack refactorPieter Wuille2012-01-061-18/+25
| | | | | | | | | | | | | | | This introduces CNetAddr and CService, respectively wrapping an (IPv6) IP address and an IP+port combination. This functionality used to be part of CAddress, which also contains network flags and connection attempt information. These extra fields are however not always necessary. These classes, along with logic for creating connections and doing name lookups, are moved to netbase.{h,cpp}, which does not depend on headers.h. Furthermore, CNetAddr is mostly IPv6-ready, though IPv6 functionality is not yet enabled for the application itself.
* Revert "Use standard C99 (and Qt) types for 64-bit integers"Wladimir J. van der Laan2011-12-211-6/+4
| | | | This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9.
* Use standard C99 (and Qt) types for 64-bit integersLuke Dashjr2011-12-201-4/+6
|
* Rework unit tests so test_bitcoin.cpp does not #include them allGavin Andresen2011-12-191-3/+4
|
* Orphan block fill-up-memory attack preventionGavin Andresen2011-12-011-0/+51
|
* Moved checkpoints out of main, to prep for using them to help prevent DoS ↵Gavin Andresen2011-12-011-1/+0
| | | | attacks
* Framework for banning mis-behaving peersGavin Andresen2011-09-211-0/+68