aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2013-12-05Make the rand tests determinstic. (fixes #2714)Gregory Maxwell
This avoids spurious errors with the old tests but still tests enough that if the rng is replaced with a totally broken one it should still fail.
2013-08-20Simplify storage of orphan transactionsGavin Andresen
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.
2013-08-20Make RPC password resistant to timing attacksGavin Andresen
Fixes issue#2838; this is a tweaked version of pull#2845 that should not leak the length of the password and is more generic, in case we run into other situations where we need timing-attack-resistant comparisons.
2013-05-21Add a few data-driven tests for SIGHASH_ANYONECANPAYMatt Corallo
2013-05-03Define dust transaction outputs, and make them non-standardGavin Andresen
2013-05-03Remove flaky util thread unit testsGavin Andresen
2013-04-03Port Thread* methods to boost::thread_groupGavin Andresen
2013-04-03LoopForever and ThreadTrace helpersGavin Andresen
2013-04-03Fix signed/unsigned comparison warningsGavin Andresen
2013-03-19-alertnotify=<cmd>Gavin Andresen
Runs a shell command when an AppliesToMe() alert is received. %s in the <cmd> string is replaced with the alert.strStatusBar message.
2013-03-19Some unit tests for CAlertGavin Andresen
2013-03-17Update unit test to match rule enforcement starts 21 MarchGavin Andresen
2013-03-17CheckBlock rule until 15-May for 10,000 BDB lock compatibilityGavin Andresen
2013-03-01Test canonical prunable txout format explicitlyPeter Todd
2013-03-01Add coverage for all invalid opsPeter Todd
0xba thru 0xff
2013-02-18Internal RNG for approximateBestSubset to prevent degenerate behavior.Gregory Maxwell
This fixes test_bitcoin failures on openbsd reported by dhill on IRC. On some systems rand() is a simple LCG over 2^31 and so it produces an even-odd sequence. ApproximateBestSubset was only using the least significant bit and so every run of the iterative solver would be the same for some inputs, resulting in some pretty dumb decisions. Using something other than the least significant bit would paper over the issue but who knows what other way a system's rand() might get us here. Instead we use an internal RNG with a period of something like 2^60 which is well behaved. This also makes it possible to make the selection deterministic for the tests, if we wanted to implement that.
2013-02-01Make sure the genesis block is present after reindexPieter Wuille
2013-01-30CValidationState frameworkPieter Wuille
2013-01-17Merge pull request #2060 from sipa/parallelGavin Andresen
Parallel script verification
2013-01-16Add nFlags to CBloomFilter to make filter updating optional.Matt Corallo
2013-01-16Use CPartialMerkleTree for CMerkleBlock transactions.Matt Corallo
2013-01-16Add CPartialMerkleTreePieter Wuille
This adds a compact representation for a subset of a merkle tree's nodes.
2013-01-16Add a nTweak to bloom filters to tweak the seed.Matt Corallo
2013-01-16Add test cases for CMerkleBlock and CBloomFilter.Matt Corallo
2013-01-10Merge pull request #2115 from forrestv/getblocktemplate_allfeesPieter Wuille
Provide fee data for all txs in RPC getblocktemplate response
2013-01-08Parallelize script verificationPieter Wuille
* During block verification (when parallelism is requested), script check actions are stored instead of being executed immediately. * After every processed transactions, its signature actions are pushed to a CScriptCheckQueue, which maintains a queue and some synchronization mechanism. * Two or more threads (if enabled) start processing elements from this queue, * When the block connection code is finished processing transactions, it joins the worker pool until the queue is empty. As cs_main is held the entire time, and all verification must be finished before the block continues processing, this does not reach the best possible performance. It is a less drastic change than some more advanced mechanisms (like doing verification out-of-band entirely, and rolling back blocks when a failure is detected). The -par=N flag controls the number of threads (1-16). 0 means auto, and is the default.
2013-01-01test/util_tests.cpp: one more DateTimeStrFormat 'T' removalJeff Garzik
2012-12-19changed CreateNewBlock to return a CBlockTemplate object, which includes ↵Forrest Voight
per-tx fee and sigop count data
2012-12-13Merge pull request #2096 from 94m3k1n9/fix-time-formatsPieter Wuille
Change timestamps to use ISO8601 formatting
2012-12-12Merge pull request #1825 from roques/bignum2Gavin Andresen
Bignum2
2012-12-12Change timestamps to use ISO8601 formattingRichard Schwab
2012-11-29Make test_bitcoin run in a temp datadirPieter Wuille
2012-11-15Introduce script verification flagsPieter Wuille
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.
2012-11-10Fix tests after cache tweaksPieter Wuille
2012-11-09Add -reindex, to perform in-place reindexing of block chain filesPieter Wuille
Flushes the blktree/ and coins/ databases, and reindexes the block chain files, as if their contents was loaded via -loadblock. Based on earlier work by Jeff Garzik.
2012-10-29Add redeemScript to listunspent output and signrawtransaction inputGavin Andresen
signrawtransaction was unable to sign pay-to-script-hash inputs when given the list of private keys to use. With this commit you can provide the p2sh redemption script in the list of inputs.
2012-10-29Tests for raw transactions argument checkingGavin Andresen
2012-10-29No need for test fixture now that multisig is enabled on main network.Gavin Andresen
2012-10-21change blockchain -> block chain (spelling)Philip Kaufmann
- Wiki says "block chain" is correct ;) - remove some unneeded spaces I found in the source, while fixing the spelling
2012-10-20Remove BDB block database supportPieter Wuille
2012-10-20Add LevelDB MemEnv supportPieter Wuille
Support LevelDB memory-backed environments, and use them in unit tests.
2012-10-20Use singleton block tree database instancePieter Wuille
2012-10-20Direct CCoins referencesPieter Wuille
To prevent excessive copying of CCoins in and out of the CCoinsView implementations, introduce a GetCoins() function in CCoinsViewCache with returns a direct reference. The block validation and connection logic is updated to require caching CCoinsViews, and exploits the GetCoins() function heavily.
2012-10-20UltraprunePieter Wuille
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.
2012-10-20Compact serialization for amountsPieter Wuille
Special serializer/deserializer for amount values. It is optimized for values which have few non-zero digits in decimal representation. Most amounts currently in the txout set take only 1 or 2 bytes to represent.
2012-10-20Compact serialization for variable-length integersPieter Wuille
Variable-length integers: bytes are a MSB base-128 encoding of the number. The high bit in each byte signifies whether another digit follows. To make the encoding is one-to-one, one is subtracted from all but the last digit. Thus, the byte sequence a[] with length len, where all but the last byte has bit 128 set, encodes the number: (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1)) Properties: * Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes) * Every integer has exactly one encoding * Encoding does not depend on size of original integer type
2012-10-20Merge pull request #1742 from sipa/canonicalJeff Garzik
Check for canonical public keys and signatures
2012-10-01data-driven base58 CBitcoinAddress/CBitcoinSecret testsWladimir J. van der Laan
Arbitrary numbers of test vectors can be generated using the script `gen_base58_test_vectors.py`.
2012-09-21Check for canonical public keys and signaturesPieter Wuille
Only enabled inside tests for now.
2012-09-18Merge branch 'testdata' of git://github.com/TheBlueMatt/bitcoinGavin Andresen