aboutsummaryrefslogtreecommitdiff
path: root/src/test/coins_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* test: Fix test_random includesMarcoFalke2016-11-071-1/+1
|
* Kill insecure_random and associated global stateWladimir J. van der Laan2016-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.
* Remove obsolete reference to CValidationState from UpdateCoins.21E142016-04-301-2/+1
|
* Add tests for CCoins deserializationPieter Wuille2016-04-251-0/+71
|
* txdb: Add Cursor() method to CCoinsView to iterate over UTXO setWladimir J. van der Laan2016-04-151-2/+0
| | | | | | | | | | Add a method Cursor() to CCoinsView that returns a cursor which can be used to iterate over the whole UTXO set. - rpc: Change gettxoutsetinfo to use new Cursor method - txdb: Remove GetStats method - Now that GetStats is implemented in terms of Cursor, remove it.
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Alter assumptions in CCoinsViewCache::BatchWriteAlex Morcos2015-11-181-0/+16
| | | | Previously it would break if you flushed a parent cache while there was a child cache referring to it. This change will allow the flushing of parent caches.
* Add unit test for UpdateCoinsAlex Morcos2015-11-121-0/+131
|
* Make CCoinsViewTest behave like CCoinsViewDBAlex Morcos2015-11-111-6/+9
|
* Separate core memory usage computation in core_memusage.hPieter Wuille2015-07-201-2/+2
|
* Keep track of memory usage in CCoinsViewCachePieter Wuille2015-05-111-3/+24
|
* tests: add a BasicTestingSetup and apply to all testsWladimir J. van der Laan2015-03-121-1/+2
| | | | | | | | Make sure that chainparams and logging is properly initialized. Doing this for every test may be overkill, but this initialization is so simple that that does not matter. This should fix the travis issues.
* Get rid of the dummy CCoinsViewCache constructor argPieter Wuille2014-09-241-2/+2
|
* Add coins_tests with a large randomized CCoinViewCache test.Pieter Wuille2014-09-231-0/+178